UAS - INTRODUCTION TO DATA SCIENCE - STAT6152016¶

Format nama files: nim_nama.ipynb; nim_nama.pdf; nim_nama.rar¶

NIM: 2540119596¶

Nama: Belinda Mutiara¶

Link Video: https://drive.google.com/drive/folders/1wU5cNLLA4GwUzGYtCEwamIJ9Qu440wVm?usp=sharing¶

Exploratory data analysis and visualization using Python¶

Memuat Libraries¶

In [1]:
# Import packages
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns
# Set style & figures inline
sns.set()
%matplotlib inline

!pip install pandas
!pip install numpy
!pip install plotly
!pip install requests
!pip install beautifulsoup4

import plotly.express as px
import plotly.graph_objects as go
from plotly.subplots import make_subplots
import requests
from bs4 import BeautifulSoup
import datetime
Requirement already satisfied: pandas in c:\users\belindam\anaconda3\lib\site-packages (1.4.4)
Requirement already satisfied: pytz>=2020.1 in c:\users\belindam\anaconda3\lib\site-packages (from pandas) (2022.1)
Requirement already satisfied: python-dateutil>=2.8.1 in c:\users\belindam\anaconda3\lib\site-packages (from pandas) (2.8.2)
Requirement already satisfied: numpy>=1.18.5 in c:\users\belindam\anaconda3\lib\site-packages (from pandas) (1.21.5)
Requirement already satisfied: six>=1.5 in c:\users\belindam\anaconda3\lib\site-packages (from python-dateutil>=2.8.1->pandas) (1.16.0)
Requirement already satisfied: numpy in c:\users\belindam\anaconda3\lib\site-packages (1.21.5)
Requirement already satisfied: plotly in c:\users\belindam\anaconda3\lib\site-packages (5.9.0)
Requirement already satisfied: tenacity>=6.2.0 in c:\users\belindam\anaconda3\lib\site-packages (from plotly) (8.0.1)
Requirement already satisfied: requests in c:\users\belindam\anaconda3\lib\site-packages (2.28.1)
Requirement already satisfied: idna<4,>=2.5 in c:\users\belindam\anaconda3\lib\site-packages (from requests) (3.3)
Requirement already satisfied: certifi>=2017.4.17 in c:\users\belindam\anaconda3\lib\site-packages (from requests) (2022.9.14)
Requirement already satisfied: charset-normalizer<3,>=2 in c:\users\belindam\anaconda3\lib\site-packages (from requests) (2.0.4)
Requirement already satisfied: urllib3<1.27,>=1.21.1 in c:\users\belindam\anaconda3\lib\site-packages (from requests) (1.26.11)
Requirement already satisfied: beautifulsoup4 in c:\users\belindam\anaconda3\lib\site-packages (4.11.1)
Requirement already satisfied: soupsieve>1.2 in c:\users\belindam\anaconda3\lib\site-packages (from beautifulsoup4) (2.3.1)

Memuat Data¶

In [2]:
confirmed_cases_data = 'time_series_covid19_confirmed_global.csv'
death_cases_data = 'time_series_covid19_deaths_global.csv'
recovery_cases_data = 'time_series_covid19_recovered_global.csv'

# Import datasets as pandas dataframes
raw_data_confirmed = pd.read_csv(confirmed_cases_data)
raw_data_deaths = pd.read_csv(death_cases_data)
raw_data_recovered = pd.read_csv(recovery_cases_data)

Kasus terkonfirmasi COVID-19¶

Langkah selanjutnya dalam proses explorasi dan visualisai data covid-19 adalah menampilkan beberapa baris teratas, informasi, dan deskriptif statistik dataframe raw_data_confirmed

In [3]:
raw_data_confirmed.head(10)
Out[3]:
Province/State Country/Region Lat Long 1/22/20 1/23/20 1/24/20 1/25/20 1/26/20 1/27/20 ... 3/29/20 3/30/20 3/31/20 4/1/20 4/2/20 4/3/20 4/4/20 4/5/20 4/6/20 4/7/20
0 NaN Afghanistan 33.0000 65.0000 0 0 0 0 0 0 ... 120 170 174 237 273 281 299 349 367 423
1 NaN Albania 41.1533 20.1683 0 0 0 0 0 0 ... 212 223 243 259 277 304 333 361 377 383
2 NaN Algeria 28.0339 1.6596 0 0 0 0 0 0 ... 511 584 716 847 986 1171 1251 1320 1423 1468
3 NaN Andorra 42.5063 1.5218 0 0 0 0 0 0 ... 334 370 376 390 428 439 466 501 525 545
4 NaN Angola -11.2027 17.8739 0 0 0 0 0 0 ... 7 7 7 8 8 8 10 14 16 17
5 NaN Antigua and Barbuda 17.0608 -61.7964 0 0 0 0 0 0 ... 7 7 7 7 9 15 15 15 15 19
6 NaN Argentina -38.4161 -63.6167 0 0 0 0 0 0 ... 745 820 1054 1054 1133 1265 1451 1451 1554 1628
7 NaN Armenia 40.0691 45.0382 0 0 0 0 0 0 ... 424 482 532 571 663 736 770 822 833 853
8 Australian Capital Territory Australia -35.4735 149.0124 0 0 0 0 0 0 ... 77 78 80 84 87 91 93 96 96 96
9 New South Wales Australia -33.8688 151.2093 0 0 0 0 3 4 ... 1791 2032 2032 2182 2298 2389 2493 2580 2637 2686

10 rows × 81 columns

In [4]:
raw_data_confirmed.info()
<class 'pandas.core.frame.DataFrame'>
RangeIndex: 263 entries, 0 to 262
Data columns (total 81 columns):
 #   Column          Non-Null Count  Dtype  
---  ------          --------------  -----  
 0   Province/State  82 non-null     object 
 1   Country/Region  263 non-null    object 
 2   Lat             263 non-null    float64
 3   Long            263 non-null    float64
 4   1/22/20         263 non-null    int64  
 5   1/23/20         263 non-null    int64  
 6   1/24/20         263 non-null    int64  
 7   1/25/20         263 non-null    int64  
 8   1/26/20         263 non-null    int64  
 9   1/27/20         263 non-null    int64  
 10  1/28/20         263 non-null    int64  
 11  1/29/20         263 non-null    int64  
 12  1/30/20         263 non-null    int64  
 13  1/31/20         263 non-null    int64  
 14  2/1/20          263 non-null    int64  
 15  2/2/20          263 non-null    int64  
 16  2/3/20          263 non-null    int64  
 17  2/4/20          263 non-null    int64  
 18  2/5/20          263 non-null    int64  
 19  2/6/20          263 non-null    int64  
 20  2/7/20          263 non-null    int64  
 21  2/8/20          263 non-null    int64  
 22  2/9/20          263 non-null    int64  
 23  2/10/20         263 non-null    int64  
 24  2/11/20         263 non-null    int64  
 25  2/12/20         263 non-null    int64  
 26  2/13/20         263 non-null    int64  
 27  2/14/20         263 non-null    int64  
 28  2/15/20         263 non-null    int64  
 29  2/16/20         263 non-null    int64  
 30  2/17/20         263 non-null    int64  
 31  2/18/20         263 non-null    int64  
 32  2/19/20         263 non-null    int64  
 33  2/20/20         263 non-null    int64  
 34  2/21/20         263 non-null    int64  
 35  2/22/20         263 non-null    int64  
 36  2/23/20         263 non-null    int64  
 37  2/24/20         263 non-null    int64  
 38  2/25/20         263 non-null    int64  
 39  2/26/20         263 non-null    int64  
 40  2/27/20         263 non-null    int64  
 41  2/28/20         263 non-null    int64  
 42  2/29/20         263 non-null    int64  
 43  3/1/20          263 non-null    int64  
 44  3/2/20          263 non-null    int64  
 45  3/3/20          263 non-null    int64  
 46  3/4/20          263 non-null    int64  
 47  3/5/20          263 non-null    int64  
 48  3/6/20          263 non-null    int64  
 49  3/7/20          263 non-null    int64  
 50  3/8/20          263 non-null    int64  
 51  3/9/20          263 non-null    int64  
 52  3/10/20         263 non-null    int64  
 53  3/11/20         263 non-null    int64  
 54  3/12/20         263 non-null    int64  
 55  3/13/20         263 non-null    int64  
 56  3/14/20         263 non-null    int64  
 57  3/15/20         263 non-null    int64  
 58  3/16/20         263 non-null    int64  
 59  3/17/20         263 non-null    int64  
 60  3/18/20         263 non-null    int64  
 61  3/19/20         263 non-null    int64  
 62  3/20/20         263 non-null    int64  
 63  3/21/20         263 non-null    int64  
 64  3/22/20         263 non-null    int64  
 65  3/23/20         263 non-null    int64  
 66  3/24/20         263 non-null    int64  
 67  3/25/20         263 non-null    int64  
 68  3/26/20         263 non-null    int64  
 69  3/27/20         263 non-null    int64  
 70  3/28/20         263 non-null    int64  
 71  3/29/20         263 non-null    int64  
 72  3/30/20         263 non-null    int64  
 73  3/31/20         263 non-null    int64  
 74  4/1/20          263 non-null    int64  
 75  4/2/20          263 non-null    int64  
 76  4/3/20          263 non-null    int64  
 77  4/4/20          263 non-null    int64  
 78  4/5/20          263 non-null    int64  
 79  4/6/20          263 non-null    int64  
 80  4/7/20          263 non-null    int64  
dtypes: float64(2), int64(77), object(2)
memory usage: 166.6+ KB
In [5]:
raw_data_confirmed.describe()
Out[5]:
Lat Long 1/22/20 1/23/20 1/24/20 1/25/20 1/26/20 1/27/20 1/28/20 1/29/20 ... 3/29/20 3/30/20 3/31/20 4/1/20 4/2/20 4/3/20 4/4/20 4/5/20 4/6/20 4/7/20
count 263.000000 263.000000 263.000000 263.000000 263.000000 263.000000 263.000000 263.000000 263.000000 263.000000 ... 263.000000 263.000000 263.000000 263.000000 263.000000 263.000000 263.000000 263.000000 263.000000 263.000000
mean 21.339244 22.068133 2.110266 2.486692 3.577947 5.452471 8.053232 11.129278 21.209125 23.444867 ... 2738.174905 2974.885932 3260.406844 3546.026616 3852.927757 4166.984791 4552.870722 4836.939163 5114.452471 5422.418251
std 24.779585 70.785949 27.434015 27.532888 34.275498 47.702207 66.662110 89.815834 220.427512 221.769901 ... 13348.022358 14659.339365 16274.718201 17892.269613 19740.409389 21707.026686 23983.928488 25717.561274 27517.452168 29418.401918
min -51.796300 -135.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 ... 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000
25% 6.938500 -21.031300 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 ... 12.000000 14.000000 15.000000 17.000000 19.500000 20.500000 21.000000 22.000000 24.000000 27.000000
50% 23.634500 20.168300 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 ... 126.000000 139.000000 143.000000 168.000000 176.000000 184.000000 195.000000 214.000000 226.000000 237.000000
75% 41.178850 79.500000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 ... 642.500000 685.500000 715.000000 780.000000 881.000000 949.000000 983.500000 1020.000000 1068.500000 1135.500000
max 71.706900 178.065000 444.000000 444.000000 549.000000 761.000000 1058.000000 1423.000000 3554.000000 3554.000000 ... 140909.000000 161837.000000 188172.000000 213372.000000 243616.000000 275586.000000 308850.000000 337072.000000 366667.000000 396223.000000

8 rows × 79 columns

1. Jumlah kasus terkonfirmasi COVID-19 berdasarkan negara (Bobot: 15%)¶

Informasi diatas masih sangat general sehingga anda perlu mendapatkan informasi yang lebih spesifik, salah satunya mendapatkan informasi jumlah kasus terkonfirmasi COVID-19 berdasarkan kriteria tertentu. Anda perlu menampilkan dataframeconfirmed_countryyang berisi jumlah kasus terkonfirmasi COVID-19 di setiap negara berdasarkan deret waktu(time series) yang terindeks berdasarkan waktu(date/time) bukan berdasarkan Country/Region.

In [6]:
confirmed_country = raw_data_confirmed.melt(id_vars=['Province/State','Country/Region','Lat','Long'],
                                            value_vars=raw_data_confirmed.iloc[:,4:],
                                            var_name='Date', value_name='Total Pasien Terkonfirmasi')
In [7]:
confirmed_country.head(10)
Out[7]:
Province/State Country/Region Lat Long Date Total Pasien Terkonfirmasi
0 NaN Afghanistan 33.0000 65.0000 1/22/20 0
1 NaN Albania 41.1533 20.1683 1/22/20 0
2 NaN Algeria 28.0339 1.6596 1/22/20 0
3 NaN Andorra 42.5063 1.5218 1/22/20 0
4 NaN Angola -11.2027 17.8739 1/22/20 0
5 NaN Antigua and Barbuda 17.0608 -61.7964 1/22/20 0
6 NaN Argentina -38.4161 -63.6167 1/22/20 0
7 NaN Armenia 40.0691 45.0382 1/22/20 0
8 Australian Capital Territory Australia -35.4735 149.0124 1/22/20 0
9 New South Wales Australia -33.8688 151.2093 1/22/20 0
In [8]:
confirmed_country["Date"] = pd.to_datetime(confirmed_country["Date"])
confirmed_country
Out[8]:
Province/State Country/Region Lat Long Date Total Pasien Terkonfirmasi
0 NaN Afghanistan 33.00000 65.000000 2020-01-22 0
1 NaN Albania 41.15330 20.168300 2020-01-22 0
2 NaN Algeria 28.03390 1.659600 2020-01-22 0
3 NaN Andorra 42.50630 1.521800 2020-01-22 0
4 NaN Angola -11.20270 17.873900 2020-01-22 0
... ... ... ... ... ... ...
20246 Falkland Islands (Malvinas) United Kingdom -51.79630 -59.523600 2020-04-07 2
20247 Saint Pierre and Miquelon France 46.88520 -56.315900 2020-04-07 1
20248 NaN South Sudan 6.87700 31.307000 2020-04-07 2
20249 NaN Western Sahara 24.21550 -12.885800 2020-04-07 4
20250 NaN Sao Tome and Principe 0.18636 6.613081 2020-04-07 4

20251 rows × 6 columns

In [9]:
confirmed_country = confirmed_country.drop(["Province/State","Lat","Long"], axis = 1)
In [10]:
confirmed_country.head(10)
Out[10]:
Country/Region Date Total Pasien Terkonfirmasi
0 Afghanistan 2020-01-22 0
1 Albania 2020-01-22 0
2 Algeria 2020-01-22 0
3 Andorra 2020-01-22 0
4 Angola 2020-01-22 0
5 Antigua and Barbuda 2020-01-22 0
6 Argentina 2020-01-22 0
7 Armenia 2020-01-22 0
8 Australia 2020-01-22 0
9 Australia 2020-01-22 0
In [11]:
confirmed_country = confirmed_country.groupby(['Date','Country/Region'],as_index=False).agg({'Total Pasien Terkonfirmasi': 'sum'})
In [12]:
confirmed_country.info()
<class 'pandas.core.frame.DataFrame'>
RangeIndex: 14168 entries, 0 to 14167
Data columns (total 3 columns):
 #   Column                      Non-Null Count  Dtype         
---  ------                      --------------  -----         
 0   Date                        14168 non-null  datetime64[ns]
 1   Country/Region              14168 non-null  object        
 2   Total Pasien Terkonfirmasi  14168 non-null  int64         
dtypes: datetime64[ns](1), int64(1), object(1)
memory usage: 332.2+ KB
In [13]:
confirmed_country = confirmed_country.pivot_table(index=['Date'], columns='Country/Region',
                     values='Total Pasien Terkonfirmasi', aggfunc='first').reset_index()
In [14]:
confirmed_country
Out[14]:
Country/Region Date Afghanistan Albania Algeria Andorra Angola Antigua and Barbuda Argentina Armenia Australia ... United Arab Emirates United Kingdom Uruguay Uzbekistan Venezuela Vietnam West Bank and Gaza Western Sahara Zambia Zimbabwe
0 2020-01-22 0 0 0 0 0 0 0 0 0 ... 0 0 0 0 0 0 0 0 0 0
1 2020-01-23 0 0 0 0 0 0 0 0 0 ... 0 0 0 0 0 2 0 0 0 0
2 2020-01-24 0 0 0 0 0 0 0 0 0 ... 0 0 0 0 0 2 0 0 0 0
3 2020-01-25 0 0 0 0 0 0 0 0 0 ... 0 0 0 0 0 2 0 0 0 0
4 2020-01-26 0 0 0 0 0 0 0 0 4 ... 0 0 0 0 0 2 0 0 0 0
... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ...
72 2020-04-03 281 304 1171 439 8 15 1265 736 5330 ... 1264 38689 369 227 153 237 194 0 39 9
73 2020-04-04 299 333 1251 466 10 15 1451 770 5550 ... 1505 42477 400 266 155 240 217 0 39 9
74 2020-04-05 349 361 1320 501 14 15 1451 822 5687 ... 1799 48436 400 342 159 241 237 4 39 9
75 2020-04-06 367 377 1423 525 16 15 1554 833 5797 ... 2076 52279 406 457 165 245 254 4 39 10
76 2020-04-07 423 383 1468 545 17 19 1628 853 5895 ... 2359 55949 424 520 165 249 261 4 39 11

77 rows × 185 columns

In [15]:
pd.set_option('display.max_columns', None)
confirmed_country = confirmed_country.set_index(['Date'])
confirmed_country
Out[15]:
Country/Region Afghanistan Albania Algeria Andorra Angola Antigua and Barbuda Argentina Armenia Australia Austria Azerbaijan Bahamas Bahrain Bangladesh Barbados Belarus Belgium Belize Benin Bhutan Bolivia Bosnia and Herzegovina Botswana Brazil Brunei Bulgaria Burkina Faso Burma Burundi Cabo Verde Cambodia Cameroon Canada Central African Republic Chad Chile China Colombia Congo (Brazzaville) Congo (Kinshasa) Costa Rica Cote d'Ivoire Croatia Cuba Cyprus Czechia Denmark Diamond Princess Djibouti Dominica Dominican Republic Ecuador Egypt El Salvador Equatorial Guinea Eritrea Estonia Eswatini Ethiopia Fiji Finland France Gabon Gambia Georgia Germany Ghana Greece Grenada Guatemala Guinea Guinea-Bissau Guyana Haiti Holy See Honduras Hungary Iceland India Indonesia Iran Iraq Ireland Israel Italy Jamaica Japan Jordan Kazakhstan Kenya Korea, South Kosovo Kuwait Kyrgyzstan Laos Latvia Lebanon Liberia Libya Liechtenstein Lithuania Luxembourg MS Zaandam Madagascar Malawi Malaysia Maldives Mali Malta Mauritania Mauritius Mexico Moldova Monaco Mongolia Montenegro Morocco Mozambique Namibia Nepal Netherlands New Zealand Nicaragua Niger Nigeria North Macedonia Norway Oman Pakistan Panama Papua New Guinea Paraguay Peru Philippines Poland Portugal Qatar Romania Russia Rwanda Saint Kitts and Nevis Saint Lucia Saint Vincent and the Grenadines San Marino Sao Tome and Principe Saudi Arabia Senegal Serbia Seychelles Sierra Leone Singapore Slovakia Slovenia Somalia South Africa South Sudan Spain Sri Lanka Sudan Suriname Sweden Switzerland Syria Taiwan* Tanzania Thailand Timor-Leste Togo Trinidad and Tobago Tunisia Turkey US Uganda Ukraine United Arab Emirates United Kingdom Uruguay Uzbekistan Venezuela Vietnam West Bank and Gaza Western Sahara Zambia Zimbabwe
Date
2020-01-22 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 548 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 2 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 2 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0
2020-01-23 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 643 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 2 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 1 0 3 0 0 0 0 0 1 0 0 0 0 0 0 0 2 0 0 0 0
2020-01-24 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 920 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 2 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 2 0 0 0 2 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 3 0 0 0 0 0 0 0 0 0 0 0 0 3 0 5 0 0 0 0 0 2 0 0 0 0 0 0 0 2 0 0 0 0
2020-01-25 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1406 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 3 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 2 0 0 0 2 0 0 0 0 0 0 0 0 0 0 0 0 0 0 3 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 3 0 0 0 0 0 0 0 0 0 0 0 0 3 0 7 0 0 0 0 0 2 0 0 0 0 0 0 0 2 0 0 0 0
2020-01-26 0 0 0 0 0 0 0 0 4 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 2075 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 3 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 4 0 0 0 3 0 0 0 0 0 0 0 0 0 0 0 0 0 0 4 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 4 0 0 0 0 0 0 0 0 0 0 0 0 4 0 8 0 0 0 0 0 5 0 0 0 0 0 0 0 2 0 0 0 0
... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ...
2020-04-03 281 304 1171 439 8 15 1265 736 5330 11524 443 24 672 61 51 351 16770 4 16 5 132 579 4 9056 134 485 302 20 3 6 114 509 12437 8 8 3737 82511 1267 22 134 416 218 1079 269 396 4091 3946 712 49 12 1488 3368 985 46 16 22 961 9 35 7 1615 65202 21 4 155 91159 205 1613 12 50 73 15 23 18 7 222 623 1364 2567 1986 53183 820 4273 7428 119827 47 2617 310 464 122 10062 126 417 130 10 493 508 7 11 75 696 2612 9 70 3 3333 19 39 202 6 186 1510 591 64 14 174 791 10 14 6 15821 868 5 120 210 430 5370 252 2686 1475 1 92 1595 3018 3383 9886 1075 3183 4149 89 9 13 3 245 0 2039 207 1476 10 2 1114 450 934 7 1505 0 119199 159 10 10 6131 19606 16 348 20 1978 1 40 98 495 20921 275586 48 1072 1264 38689 369 227 153 237 194 0 39 9
2020-04-04 299 333 1251 466 10 15 1451 770 5550 11781 521 28 688 70 52 440 18431 4 16 5 139 624 4 10360 135 503 318 21 3 7 114 555 12978 8 9 4161 82543 1406 22 154 435 245 1126 288 426 4472 4269 712 50 14 1488 3465 1070 56 16 29 1039 9 38 12 1882 90848 21 4 162 96092 205 1673 12 61 111 18 23 20 7 264 678 1417 3082 2092 55743 878 4604 7851 124632 53 3139 323 531 126 10156 135 479 144 10 509 520 10 18 77 771 2729 9 70 4 3483 19 41 213 6 196 1688 752 66 14 201 919 10 14 9 16727 950 5 144 214 483 5550 277 2818 1673 1 96 1746 3094 3627 10524 1325 3613 4731 102 9 14 7 259 0 2179 219 1624 10 4 1189 471 977 7 1585 0 126168 166 10 10 6443 20505 16 355 20 2067 1 41 103 553 23934 308850 48 1225 1505 42477 400 266 155 240 217 0 39 9
2020-04-05 349 361 1320 501 14 15 1451 822 5687 12051 584 28 700 88 56 562 19691 5 22 5 157 654 6 11130 135 531 345 21 3 7 114 650 15756 8 9 4471 82602 1485 45 154 454 261 1182 320 446 4587 4561 712 59 14 1745 3646 1173 62 16 29 1097 9 43 12 1927 93773 21 4 174 100123 214 1735 12 61 121 18 24 21 7 268 733 1486 3588 2273 58226 961 4994 8430 128948 58 3139 345 584 142 10237 145 556 147 11 533 527 13 18 77 811 2804 9 72 4 3662 19 45 227 6 227 1890 864 73 14 214 1021 10 16 9 17953 1039 6 184 232 555 5687 298 3157 1801 1 104 2281 3246 4102 11278 1604 3864 5389 104 10 14 7 266 0 2402 222 1908 10 6 1309 485 997 7 1655 1 131646 176 12 10 6830 21100 19 363 22 2169 1 44 104 574 27069 337072 52 1308 1799 48436 400 342 159 241 237 4 39 9
2020-04-06 367 377 1423 525 16 15 1554 833 5797 12297 641 29 756 123 60 700 20814 7 26 5 183 674 6 12161 135 549 364 22 3 7 114 658 16563 8 9 4815 82665 1579 45 161 467 323 1222 350 465 4822 4875 712 90 15 1828 3747 1322 69 16 31 1108 10 44 14 2176 98963 24 4 188 103374 214 1755 12 70 128 18 31 24 7 298 744 1562 4778 2491 60500 1031 5364 8904 132547 58 3654 349 662 158 10284 145 665 216 12 542 541 14 19 77 843 2843 9 82 5 3793 19 47 241 6 244 2143 965 77 15 233 1120 10 16 9 18926 1106 6 253 238 570 5865 331 3766 1988 2 113 2561 3660 4413 11730 1832 4057 6343 105 10 14 7 266 4 2605 226 2200 11 6 1375 534 1021 7 1686 1 136675 178 12 10 7206 21657 19 373 24 2220 1 58 105 596 30217 366667 52 1319 2076 52279 406 457 165 245 254 4 39 10
2020-04-07 423 383 1468 545 17 19 1628 853 5895 12639 717 33 811 164 63 861 22194 7 26 5 194 764 6 14034 135 577 384 22 3 7 115 658 17872 8 10 5116 82718 1780 45 180 483 349 1282 396 494 5017 5266 712 90 15 1956 3747 1450 78 16 31 1149 10 52 15 2308 110065 30 4 196 107663 287 1832 12 77 144 33 33 25 7 305 817 1586 5311 2738 62589 1122 5709 9248 135586 63 3906 353 697 172 10331 170 743 228 14 548 548 14 20 78 880 2970 9 88 8 3963 19 56 293 6 268 2439 1056 79 15 241 1184 10 16 9 19709 1160 6 278 254 599 6086 371 4035 2100 2 115 2954 3764 4848 12442 2057 4417 7497 105 11 14 8 279 4 2795 237 2447 11 6 1481 581 1059 8 1749 2 141942 185 14 10 7693 22253 19 376 24 2258 1 65 107 623 34109 396223 52 1462 2359 55949 424 520 165 249 261 4 39 11

77 rows × 184 columns

In [16]:
pd.set_option('display.max_columns', None)
confirmed_country.describe(include='all')
Out[16]:
Country/Region Afghanistan Albania Algeria Andorra Angola Antigua and Barbuda Argentina Armenia Australia Austria Azerbaijan Bahamas Bahrain Bangladesh Barbados Belarus Belgium Belize Benin Bhutan Bolivia Bosnia and Herzegovina Botswana Brazil Brunei Bulgaria Burkina Faso Burma Burundi Cabo Verde Cambodia Cameroon Canada Central African Republic Chad Chile China Colombia Congo (Brazzaville) Congo (Kinshasa) Costa Rica Cote d'Ivoire Croatia Cuba Cyprus Czechia Denmark Diamond Princess Djibouti Dominica Dominican Republic Ecuador Egypt El Salvador Equatorial Guinea Eritrea Estonia Eswatini Ethiopia Fiji Finland France Gabon Gambia Georgia Germany Ghana Greece Grenada Guatemala Guinea Guinea-Bissau Guyana Haiti Holy See Honduras Hungary Iceland India Indonesia Iran Iraq Ireland Israel Italy Jamaica Japan Jordan Kazakhstan Kenya Korea, South Kosovo Kuwait Kyrgyzstan Laos Latvia Lebanon Liberia Libya Liechtenstein Lithuania Luxembourg MS Zaandam Madagascar Malawi Malaysia Maldives Mali Malta Mauritania Mauritius Mexico Moldova Monaco Mongolia Montenegro Morocco Mozambique Namibia Nepal Netherlands New Zealand Nicaragua Niger Nigeria North Macedonia Norway Oman Pakistan Panama Papua New Guinea Paraguay Peru Philippines Poland Portugal Qatar Romania Russia Rwanda Saint Kitts and Nevis Saint Lucia Saint Vincent and the Grenadines San Marino Sao Tome and Principe Saudi Arabia Senegal Serbia Seychelles Sierra Leone Singapore Slovakia Slovenia Somalia South Africa South Sudan Spain Sri Lanka Sudan Suriname Sweden Switzerland Syria Taiwan* Tanzania Thailand Timor-Leste Togo Trinidad and Tobago Tunisia Turkey US Uganda Ukraine United Arab Emirates United Kingdom Uruguay Uzbekistan Venezuela Vietnam West Bank and Gaza Western Sahara Zambia Zimbabwe
count 77.000000 77.000000 77.000000 77.000000 77.000000 77.000000 77.000000 77.000000 77.000000 77.000000 77.000000 77.000000 77.000000 77.000000 77.000000 77.000000 77.000000 77.000000 77.000000 77.000000 77.000000 77.000000 77.000000 77.000000 77.000000 77.000000 77.000000 77.000000 77.000000 77.000000 77.000000 77.000000 77.000000 77.000000 77.000000 77.000000 77.000000 77.000000 77.000000 77.000000 77.000000 77.000000 77.000000 77.000000 77.000000 77.000000 77.000000 77.000000 77.000000 77.000000 77.000000 77.000000 77.000000 77.000000 77.000000 77.000000 77.000000 77.000000 77.000000 77.000000 77.000000 77.000000 77.000000 77.000000 77.000000 77.000000 77.000000 77.000000 77.000000 77.000000 77.000000 77.000000 77.000000 77.000000 77.000000 77.000000 77.000000 77.000000 77.000000 77.000000 77.000000 77.000000 77.000000 77.000000 77.000000 77.000000 77.000000 77.000000 77.000000 77.000000 77.000000 77.000000 77.000000 77.000000 77.000000 77.000000 77.000000 77.000000 77.000000 77.000000 77.000000 77.000000 77.000000 77.000000 77.000000 77.000000 77.000000 77.000000 77.000000 77.000000 77.000000 77.000000 77.000000 77.000000 77.000000 77.000000 77.000000 77.000000 77.000000 77.000000 77.000000 77.000000 77.000000 77.000000 77.000000 77.000000 77.000000 77.000000 77.000000 77.000000 77.000000 77.000000 77.000000 77.000000 77.000000 77.000000 77.000000 77.000000 77.000000 77.000000 77.000000 77.000000 77.000000 77.000000 77.000000 77.000000 77.000000 77.000000 77.000000 77.000000 77.000000 77.000000 77.000000 77.000000 77.000000 77.000000 77.000000 77.000000 77.000000 77.000000 77.000000 77.000000 77.000000 77.000000 77.000000 77.000000 77.000000 77.000000 77.000000 77.000000 77.000000 77.000000 77.000000 77.000000 77.000000 77.000000 77.000000 77.000000 77.000000 77.000000 77.000000 77.000000 77.000000 77.000000
mean 44.857143 58.779221 172.649351 78.974026 1.675325 2.025974 208.636364 121.389610 966.038961 2168.220779 72.636364 3.714286 165.857143 15.090909 8.012987 62.961039 2808.402597 0.662338 2.597403 1.038961 22.402597 92.376623 0.532468 1412.376623 34.103896 92.207792 54.337662 2.545455 0.285714 1.233766 26.610390 60.207792 1931.311688 1.129870 1.233766 602.571429 61878.272727 206.168831 4.116883 21.662338 78.090909 36.766234 185.545455 40.103896 64.831169 731.675325 811.779221 480.883117 6.961039 2.246753 224.792208 524.064935 192.207792 7.012987 3.116883 3.168831 186.285714 1.818182 6.142857 1.545455 341.441558 12822.610390 3.142857 0.818182 30.987013 16231.623377 34.675325 324.363636 1.701299 9.584416 9.909091 1.896104 4.064935 3.064935 1.376623 33.363636 106.714286 276.025974 444.220779 350.883117 11894.363636 164.688312 721.415584 1136.311688 26992.792208 9.766234 669.610390 60.753247 73.883117 16.636364 4259.935065 19.727273 101.870130 21.805195 1.649351 88.389610 114.402597 1.441558 1.818182 15.857143 115.012987 467.194805 0.922078 9.987013 0.350649 681.311688 5.480519 5.207792 42.428571 1.142857 29.766234 249.207792 97.194805 11.792208 3.246753 26.389610 131.883117 1.636364 2.610390 1.883117 2852.441558 133.337662 0.922078 16.493506 30.532468 75.948052 1169.337662 47.948052 475.168831 244.831169 0.272727 15.740260 280.207792 431.961039 546.714286 1559.272727 259.350649 507.454545 606.727273 16.233766 1.181818 2.090909 0.688312 68.311688 0.103896 362.220779 38.181818 230.532468 2.376623 0.376623 281.051948 88.142857 199.155844 0.974026 275.259740 0.051948 20967.662338 34.623377 1.636364 2.051948 1152.454545 3855.233766 2.168831 91.272727 4.064935 374.597403 0.220779 7.805195 18.935065 80.454545 2971.948052 41931.961039 7.168831 144.688312 216.051948 6072.844156 70.350649 42.337662 30.935065 59.649351 36.532468 0.155844 6.025974 1.532468
std 96.349516 105.241405 366.068974 154.181538 3.729123 4.301083 427.103461 235.506629 1787.144278 3922.499588 159.561151 8.063657 229.753169 29.775114 16.413644 154.117474 5673.749942 1.535633 5.788509 1.584809 46.622295 189.210760 1.518174 3127.909357 51.186600 164.768285 106.381712 6.309027 0.856202 2.333374 42.747778 155.541443 4233.173254 2.154253 2.655164 1273.367587 29056.328977 430.525517 10.131989 45.138270 142.085888 81.235022 358.443035 91.019313 127.137659 1386.498528 1353.824637 307.498779 18.386524 4.718820 494.007760 1064.491296 344.350355 17.088387 5.443427 7.834476 323.878505 3.370644 12.059845 3.354280 600.881797 25646.732643 6.744811 1.466533 50.706714 30258.667724 71.350219 537.939977 3.755925 18.587879 29.666205 5.524073 7.788888 6.471268 2.322878 75.863088 211.377615 467.988584 1048.533294 680.517546 17903.433811 283.762422 1449.580296 2422.764734 42182.079927 16.860805 922.346367 110.526272 165.468472 39.069408 4216.801842 45.489917 156.118237 49.664410 3.644629 163.182748 179.527396 3.109804 4.781343 26.753118 236.738669 885.460630 2.609528 22.308538 1.305517 1140.920384 7.284826 13.047825 74.099760 2.030778 65.166567 542.709512 226.408750 21.981055 5.226843 58.882612 284.983378 3.410159 4.801743 2.139688 5355.346987 294.984505 1.797412 52.135104 65.877395 151.462597 1856.982730 87.639948 945.675398 516.622009 0.503576 30.247402 614.361272 939.844408 1143.532383 3255.235611 440.944553 1075.276030 1508.093591 31.380473 2.932249 4.249402 1.648442 94.647443 0.640403 707.483766 69.206732 524.175031 3.762834 1.287991 377.252808 155.031806 322.872228 2.025976 534.143964 0.276067 39780.792713 56.595062 3.248113 3.586877 2000.654844 6749.319301 5.094896 116.505211 7.354443 655.328709 0.417492 15.066553 34.769291 166.073188 7446.266028 93967.244676 15.737487 349.981814 474.462075 13196.987195 129.867520 100.384997 53.837557 76.847896 63.904448 0.779084 12.890198 3.076158
min 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 548.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 2.000000 0.000000 0.000000 0.000000 1.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 1.000000 0.000000 2.000000 0.000000 0.000000 0.000000 0.000000 0.000000 1.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000
25% 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 15.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 1.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 1.000000 0.000000 7.000000 0.000000 0.000000 0.000000 42354.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 135.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 1.000000 11.000000 0.000000 0.000000 0.000000 14.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 3.000000 0.000000 0.000000 0.000000 0.000000 0.000000 3.000000 0.000000 26.000000 0.000000 0.000000 0.000000 27.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 18.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 1.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 3.000000 0.000000 0.000000 0.000000 0.000000 2.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 45.000000 0.000000 0.000000 0.000000 0.000000 0.000000 2.000000 1.000000 0.000000 0.000000 1.000000 0.000000 0.000000 18.000000 0.000000 32.000000 0.000000 0.000000 0.000000 0.000000 0.000000 11.000000 0.000000 0.000000 8.000000 8.000000 0.000000 0.000000 0.000000 14.000000 0.000000 0.000000 0.000000 0.000000
50% 1.000000 0.000000 1.000000 0.000000 0.000000 0.000000 0.000000 0.000000 25.000000 9.000000 0.000000 0.000000 41.000000 0.000000 0.000000 1.000000 1.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 2.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 1.000000 0.000000 20.000000 0.000000 0.000000 0.000000 79356.000000 0.000000 0.000000 0.000000 0.000000 0.000000 6.000000 0.000000 0.000000 0.000000 3.000000 705.000000 0.000000 0.000000 0.000000 0.000000 1.000000 0.000000 0.000000 0.000000 1.000000 0.000000 0.000000 0.000000 3.000000 100.000000 0.000000 0.000000 1.000000 79.000000 0.000000 4.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 1.000000 3.000000 0.000000 593.000000 13.000000 1.000000 7.000000 1128.000000 0.000000 241.000000 0.000000 0.000000 0.000000 3150.000000 0.000000 45.000000 0.000000 0.000000 0.000000 4.000000 0.000000 0.000000 0.000000 1.000000 1.000000 0.000000 0.000000 0.000000 25.000000 0.000000 0.000000 0.000000 0.000000 0.000000 4.000000 0.000000 1.000000 0.000000 0.000000 0.000000 0.000000 0.000000 1.000000 6.000000 1.000000 0.000000 0.000000 1.000000 1.000000 15.000000 6.000000 4.000000 0.000000 0.000000 0.000000 0.000000 3.000000 0.000000 0.000000 1.000000 3.000000 2.000000 0.000000 0.000000 0.000000 0.000000 1.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 102.000000 0.000000 0.000000 0.000000 0.000000 0.000000 45.000000 1.000000 0.000000 0.000000 12.000000 18.000000 0.000000 39.000000 0.000000 42.000000 0.000000 0.000000 0.000000 0.000000 0.000000 68.000000 0.000000 0.000000 21.000000 23.000000 0.000000 0.000000 0.000000 16.000000 0.000000 0.000000 0.000000 0.000000
75% 22.000000 64.000000 87.000000 53.000000 0.000000 1.000000 97.000000 115.000000 681.000000 2013.000000 44.000000 3.000000 278.000000 17.000000 5.000000 51.000000 1795.000000 0.000000 2.000000 1.000000 12.000000 63.000000 0.000000 621.000000 75.000000 94.000000 33.000000 0.000000 0.000000 0.000000 37.000000 13.000000 800.000000 1.000000 1.000000 238.000000 81156.000000 102.000000 3.000000 14.000000 69.000000 9.000000 105.000000 11.000000 67.000000 694.000000 1225.000000 712.000000 1.000000 0.000000 34.000000 199.000000 256.000000 1.000000 6.000000 0.000000 267.000000 1.000000 6.000000 1.000000 400.000000 10970.000000 1.000000 1.000000 40.000000 15320.000000 11.000000 418.000000 0.000000 9.000000 1.000000 0.000000 5.000000 0.000000 1.000000 12.000000 73.000000 330.000000 194.000000 311.000000 18407.000000 192.000000 557.000000 427.000000 41035.000000 15.000000 924.000000 69.000000 44.000000 7.000000 8565.000000 0.000000 148.000000 3.000000 0.000000 86.000000 157.000000 2.000000 0.000000 28.000000 36.000000 335.000000 0.000000 0.000000 0.000000 900.000000 13.000000 0.000000 53.000000 2.000000 3.000000 118.000000 49.000000 7.000000 6.000000 3.000000 63.000000 0.000000 3.000000 1.000000 2467.000000 28.000000 1.000000 0.000000 8.000000 48.000000 1746.000000 48.000000 454.000000 109.000000 0.000000 11.000000 234.000000 217.000000 355.000000 785.000000 460.000000 277.000000 199.000000 8.000000 0.000000 2.000000 1.000000 119.000000 0.000000 274.000000 31.000000 103.000000 6.000000 0.000000 345.000000 123.000000 286.000000 1.000000 150.000000 0.000000 17963.000000 60.000000 2.000000 1.000000 1439.000000 4075.000000 0.000000 108.000000 6.000000 272.000000 0.000000 1.000000 9.000000 39.000000 192.000000 13747.000000 0.000000 16.000000 140.000000 2716.000000 79.000000 23.000000 42.000000 85.000000 44.000000 0.000000 2.000000 0.000000
max 423.000000 383.000000 1468.000000 545.000000 17.000000 19.000000 1628.000000 853.000000 5895.000000 12639.000000 717.000000 33.000000 811.000000 164.000000 63.000000 861.000000 22194.000000 7.000000 26.000000 5.000000 194.000000 764.000000 6.000000 14034.000000 135.000000 577.000000 384.000000 22.000000 3.000000 7.000000 115.000000 658.000000 17872.000000 8.000000 10.000000 5116.000000 82718.000000 1780.000000 45.000000 180.000000 483.000000 349.000000 1282.000000 396.000000 494.000000 5017.000000 5266.000000 712.000000 90.000000 15.000000 1956.000000 3747.000000 1450.000000 78.000000 16.000000 31.000000 1149.000000 10.000000 52.000000 15.000000 2308.000000 110065.000000 30.000000 4.000000 196.000000 107663.000000 287.000000 1832.000000 12.000000 77.000000 144.000000 33.000000 33.000000 25.000000 7.000000 305.000000 817.000000 1586.000000 5311.000000 2738.000000 62589.000000 1122.000000 5709.000000 9248.000000 135586.000000 63.000000 3906.000000 353.000000 697.000000 172.000000 10331.000000 170.000000 743.000000 228.000000 14.000000 548.000000 548.000000 14.000000 20.000000 78.000000 880.000000 2970.000000 9.000000 88.000000 8.000000 3963.000000 19.000000 56.000000 293.000000 6.000000 268.000000 2439.000000 1056.000000 79.000000 15.000000 241.000000 1184.000000 10.000000 16.000000 9.000000 19709.000000 1160.000000 6.000000 278.000000 254.000000 599.000000 6086.000000 371.000000 4035.000000 2100.000000 2.000000 115.000000 2954.000000 3764.000000 4848.000000 12442.000000 2057.000000 4417.000000 7497.000000 105.000000 11.000000 14.000000 8.000000 279.000000 4.000000 2795.000000 237.000000 2447.000000 11.000000 6.000000 1481.000000 581.000000 1059.000000 8.000000 1749.000000 2.000000 141942.000000 185.000000 14.000000 10.000000 7693.000000 22253.000000 19.000000 376.000000 24.000000 2258.000000 1.000000 65.000000 107.000000 623.000000 34109.000000 396223.000000 52.000000 1462.000000 2359.000000 55949.000000 424.000000 520.000000 165.000000 249.000000 261.000000 4.000000 39.000000 11.000000
In [17]:
print("Kasus terkecil namun paling tinggi: ", confirmed_country.min().max())
print("Nilai maximum namun yang paling rendah dari lainnya: ",confirmed_country.max().min())
print("Nilai maximum namun yang paling tinggi dari lainnya: ",confirmed_country.max().max())
Kasus terkecil namun paling tinggi:  548
Nilai maximum namun yang paling rendah dari lainnya:  1
Nilai maximum namun yang paling tinggi dari lainnya:  396223
In [18]:
confirmed_country.info()
<class 'pandas.core.frame.DataFrame'>
DatetimeIndex: 77 entries, 2020-01-22 to 2020-04-07
Columns: 184 entries, Afghanistan to Zimbabwe
dtypes: int64(184)
memory usage: 111.3 KB

Berdasarka tabel diatas dapat dilihat bahwa pada data set confirmed_country memiliki 77 pengamatan yakni tanggal yang berurutan mulai dari 22 Januari 2020 sampai dengan 7 April 2020. Pengamatan terdiri dari 184 kolom, dalam hal ini terdapat 184 negara mulai dari Afganistan hingga Zimbabwe. Seluruh sel diisi dengan bilangan bulat yang menyatakan jumlah kumlatif total pasien yang terkonfirmasi per harinya. Data set confirmed_country memiliki data yang lengkap, hal ini dibuktikan melalui method .info yang menyatakan bahwa tidak ditemukan missing value pada data set ini.

Berdasarkan tabel-tabel diatas didapatkan juga informasi sebagai berikut:

  • Kasus terkecil dari China merupakan yang terbesar dari yang lain, pada tanggal 22 Januari 2020, jumlah orang yang terkonfirmasi positif COVID-19 ialah sebesar 548 orang.
  • Kasus terbesar di akhir periode (Tanggal 7 April 2020) di miliki oleh negara Amerika Serikat dengan jumlah orang yang terkonfirmasi positif COVID-19 ialah sebesar 396.223 orang.
  • Di akhir periode yakni tanggal 7 April 2020, terdapat negara yang haya memiliki 1 kasus terkonfirmasi yakni berasal dari negara Timor Leste

2. Visualisasi kasus terkonfirmasi COVID-19 berdasarkan negara (Bobot: 15%)¶

Anda sudah memiliki sebuah dataframe yang berisi kasus terkonfirmasi COVID-19 yang terindeks berdasarkan waktu. Selanjutnya, visualisasikan data jumlah kasus terkonfirmasi di negara-negara berikut (Prancis, Spanyol, Cina, AS, Italia, dan Australia). Berikan judul, labels, dan spesifikasi (ukuran, warna, ketebalan, dll) yang sesuai, sehingga plot yang dihasilkan rapi, menarik, dan mudah dipahami.

In [19]:
enamnegara = confirmed_country[["France", "Spain", "China", "US", "Italy", "Australia"]]
enamnegara = pd.DataFrame(enamnegara)
enamnegara
Out[19]:
Country/Region France Spain China US Italy Australia
Date
2020-01-22 0 0 548 1 0 0
2020-01-23 0 0 643 1 0 0
2020-01-24 2 0 920 2 0 0
2020-01-25 3 0 1406 2 0 0
2020-01-26 3 0 2075 5 0 4
... ... ... ... ... ... ...
2020-04-03 65202 119199 82511 275586 119827 5330
2020-04-04 90848 126168 82543 308850 124632 5550
2020-04-05 93773 131646 82602 337072 128948 5687
2020-04-06 98963 136675 82665 366667 132547 5797
2020-04-07 110065 141942 82718 396223 135586 5895

77 rows × 6 columns

In [20]:
plt.style.use('https://github.com/dhaitz/matplotlib-stylesheets/raw/master/pitayasmoothie-light.mplstyle')
fig, axes = plt.subplots(nrows=6, ncols=1)
for i, c in enumerate(enamnegara.columns):
    enamnegara[c].plot(kind='line', ax=axes[i], title=c, xlabel="Tanggal", ylabel="Total Kasus Terkonfirmasi", legend=c, linewidth=4,fontsize=16)
plt.subplots_adjust(hspace = 1.0)
plt.gcf().set_size_inches(10, 28)
In [21]:
plt.style.use('https://github.com/dhaitz/matplotlib-stylesheets/raw/master/pitayasmoothie-light.mplstyle')
enamnegara.plot(figsize=(18,10), linewidth=3, fontsize=20)
plt.title("Kasus Terkonfirmasi COVID-19 di Prancis, Spanyol, Cina, As, Itali, dan Autralia", fontsize=20)
Out[21]:
Text(0.5, 1.0, 'Kasus Terkonfirmasi COVID-19 di Prancis, Spanyol, Cina, As, Itali, dan Autralia')
In [22]:
negara = {'Negara':pd.Series(["France", "Spain", "China","US", "Italy","Australia"]), 
        'Total Terkonfirmasi per 7 April 2020': pd.Series([110065,141942,82718,396223,135586,5895])}

datakonfirmasi = pd.DataFrame(negara)
plt.style.use('https://github.com/dhaitz/matplotlib-stylesheets/raw/master/pitayasmoothie-light.mplstyle')
datakonfirmasi.plot.bar(x="Negara", y="Total Terkonfirmasi per 7 April 2020",rot=0,figsize=(10,7), ylabel = "Jumlah Kasus", edgecolor='k', fontsize=15)
plt.title("Jumlah Akhir Kasus Terkonfirmasi di 6 Negara",fontsize=17)
Out[22]:
Text(0.5, 1.0, 'Jumlah Akhir Kasus Terkonfirmasi di 6 Negara')
Tuliskan analisis anda berdasarkan hasil visualisasi diatas:¶

Berdasarkan visualisasi di atas didapatkan informasi didapatkan informasi sebagai berikut:

  • Dari keenam negara yang ada, negara Cina ialah negara yang paling banyak memiliki kasus terkonfirmasi pada hari pertama yaitu sebanyak 548 kasus dan terus mengalami kenaikan kasus hingga periode pertengahan Februari.
  • Negara yang paling lama memiliki kasus positif COVID-19 ialah negara Spanyol. Kasus pertama negara Spanyol baru muncul pada tanggal 1 Februari 2020.
  • Semenjak sekitar awal Maret peningkatan kasus terkonfirmasi COVID-19 di China cenderung stabil/hampir tidak terjadi penambahan kasus terkonfirmasi.
  • Pada akhir periode, kasus terkonfirmasi terbanyak ialah berasal dari negara Amerika Serikat dengan total kasus terkonfirmasi mencapai 396.223 kasus, kemudian disusul dengan Spanyol(141.942 kasus), Italy(135.586 kasus), Prancis(110.065 kasus), Cina(82.718 kasus), dan Australia(5.895 kasus).

3. Jumlah kasus kematian COVID-19 yang dilaporkan berdasarkan negara (Bobot: 15%)¶

Selain informasi kasus terkonfirmasi, anda juga perlu mendapatkan informasi mengenai kasus kematian COVID-19. Tampilkan beberapa baris teratas/terbawah beserta informasi dari dataframe raw_data_deaths

In [23]:
raw_data_deaths.head()
Out[23]:
Province/State Country/Region Lat Long 1/22/20 1/23/20 1/24/20 1/25/20 1/26/20 1/27/20 1/28/20 1/29/20 1/30/20 1/31/20 2/1/20 2/2/20 2/3/20 2/4/20 2/5/20 2/6/20 2/7/20 2/8/20 2/9/20 2/10/20 2/11/20 2/12/20 2/13/20 2/14/20 2/15/20 2/16/20 2/17/20 2/18/20 2/19/20 2/20/20 2/21/20 2/22/20 2/23/20 2/24/20 2/25/20 2/26/20 2/27/20 2/28/20 2/29/20 3/1/20 3/2/20 3/3/20 3/4/20 3/5/20 3/6/20 3/7/20 3/8/20 3/9/20 3/10/20 3/11/20 3/12/20 3/13/20 3/14/20 3/15/20 3/16/20 3/17/20 3/18/20 3/19/20 3/20/20 3/21/20 3/22/20 3/23/20 3/24/20 3/25/20 3/26/20 3/27/20 3/28/20 3/29/20 3/30/20 3/31/20 4/1/20 4/2/20 4/3/20 4/4/20 4/5/20 4/6/20 4/7/20
0 NaN Afghanistan 33.0000 65.0000 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 2 4 4 4 4 4 4 4 6 6 7 7 11 14
1 NaN Albania 41.1533 20.1683 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 2 2 2 2 2 4 5 5 6 8 10 10 11 15 15 16 17 20 20 21 22
2 NaN Algeria 28.0339 1.6596 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 2 3 4 4 4 7 9 11 15 17 17 19 21 25 26 29 31 35 44 58 86 105 130 152 173 193
3 NaN Andorra 42.5063 1.5218 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 1 3 3 3 6 8 12 14 15 16 17 18 21 22
4 NaN Angola -11.2027 17.8739 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 2 2 2 2 2 2 2 2 2 2
In [24]:
raw_data_deaths.tail()
Out[24]:
Province/State Country/Region Lat Long 1/22/20 1/23/20 1/24/20 1/25/20 1/26/20 1/27/20 1/28/20 1/29/20 1/30/20 1/31/20 2/1/20 2/2/20 2/3/20 2/4/20 2/5/20 2/6/20 2/7/20 2/8/20 2/9/20 2/10/20 2/11/20 2/12/20 2/13/20 2/14/20 2/15/20 2/16/20 2/17/20 2/18/20 2/19/20 2/20/20 2/21/20 2/22/20 2/23/20 2/24/20 2/25/20 2/26/20 2/27/20 2/28/20 2/29/20 3/1/20 3/2/20 3/3/20 3/4/20 3/5/20 3/6/20 3/7/20 3/8/20 3/9/20 3/10/20 3/11/20 3/12/20 3/13/20 3/14/20 3/15/20 3/16/20 3/17/20 3/18/20 3/19/20 3/20/20 3/21/20 3/22/20 3/23/20 3/24/20 3/25/20 3/26/20 3/27/20 3/28/20 3/29/20 3/30/20 3/31/20 4/1/20 4/2/20 4/3/20 4/4/20 4/5/20 4/6/20 4/7/20
258 Falkland Islands (Malvinas) United Kingdom -51.79630 -59.523600 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
259 Saint Pierre and Miquelon France 46.88520 -56.315900 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
260 NaN South Sudan 6.87700 31.307000 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
261 NaN Western Sahara 24.21550 -12.885800 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
262 NaN Sao Tome and Principe 0.18636 6.613081 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
In [25]:
raw_data_deaths.info()
<class 'pandas.core.frame.DataFrame'>
RangeIndex: 263 entries, 0 to 262
Data columns (total 81 columns):
 #   Column          Non-Null Count  Dtype  
---  ------          --------------  -----  
 0   Province/State  82 non-null     object 
 1   Country/Region  263 non-null    object 
 2   Lat             263 non-null    float64
 3   Long            263 non-null    float64
 4   1/22/20         263 non-null    int64  
 5   1/23/20         263 non-null    int64  
 6   1/24/20         263 non-null    int64  
 7   1/25/20         263 non-null    int64  
 8   1/26/20         263 non-null    int64  
 9   1/27/20         263 non-null    int64  
 10  1/28/20         263 non-null    int64  
 11  1/29/20         263 non-null    int64  
 12  1/30/20         263 non-null    int64  
 13  1/31/20         263 non-null    int64  
 14  2/1/20          263 non-null    int64  
 15  2/2/20          263 non-null    int64  
 16  2/3/20          263 non-null    int64  
 17  2/4/20          263 non-null    int64  
 18  2/5/20          263 non-null    int64  
 19  2/6/20          263 non-null    int64  
 20  2/7/20          263 non-null    int64  
 21  2/8/20          263 non-null    int64  
 22  2/9/20          263 non-null    int64  
 23  2/10/20         263 non-null    int64  
 24  2/11/20         263 non-null    int64  
 25  2/12/20         263 non-null    int64  
 26  2/13/20         263 non-null    int64  
 27  2/14/20         263 non-null    int64  
 28  2/15/20         263 non-null    int64  
 29  2/16/20         263 non-null    int64  
 30  2/17/20         263 non-null    int64  
 31  2/18/20         263 non-null    int64  
 32  2/19/20         263 non-null    int64  
 33  2/20/20         263 non-null    int64  
 34  2/21/20         263 non-null    int64  
 35  2/22/20         263 non-null    int64  
 36  2/23/20         263 non-null    int64  
 37  2/24/20         263 non-null    int64  
 38  2/25/20         263 non-null    int64  
 39  2/26/20         263 non-null    int64  
 40  2/27/20         263 non-null    int64  
 41  2/28/20         263 non-null    int64  
 42  2/29/20         263 non-null    int64  
 43  3/1/20          263 non-null    int64  
 44  3/2/20          263 non-null    int64  
 45  3/3/20          263 non-null    int64  
 46  3/4/20          263 non-null    int64  
 47  3/5/20          263 non-null    int64  
 48  3/6/20          263 non-null    int64  
 49  3/7/20          263 non-null    int64  
 50  3/8/20          263 non-null    int64  
 51  3/9/20          263 non-null    int64  
 52  3/10/20         263 non-null    int64  
 53  3/11/20         263 non-null    int64  
 54  3/12/20         263 non-null    int64  
 55  3/13/20         263 non-null    int64  
 56  3/14/20         263 non-null    int64  
 57  3/15/20         263 non-null    int64  
 58  3/16/20         263 non-null    int64  
 59  3/17/20         263 non-null    int64  
 60  3/18/20         263 non-null    int64  
 61  3/19/20         263 non-null    int64  
 62  3/20/20         263 non-null    int64  
 63  3/21/20         263 non-null    int64  
 64  3/22/20         263 non-null    int64  
 65  3/23/20         263 non-null    int64  
 66  3/24/20         263 non-null    int64  
 67  3/25/20         263 non-null    int64  
 68  3/26/20         263 non-null    int64  
 69  3/27/20         263 non-null    int64  
 70  3/28/20         263 non-null    int64  
 71  3/29/20         263 non-null    int64  
 72  3/30/20         263 non-null    int64  
 73  3/31/20         263 non-null    int64  
 74  4/1/20          263 non-null    int64  
 75  4/2/20          263 non-null    int64  
 76  4/3/20          263 non-null    int64  
 77  4/4/20          263 non-null    int64  
 78  4/5/20          263 non-null    int64  
 79  4/6/20          263 non-null    int64  
 80  4/7/20          263 non-null    int64  
dtypes: float64(2), int64(77), object(2)
memory usage: 166.6+ KB

Berdasarka tabel diatas dapat dilihat bahwa pada data set raw_data_deaths memiliki 77 pengamatan yakni tanggal yang berurutan mulai dari 22 Januari 2020 sampai dengan 7 April 2020. Pengamatan terdiri dari 263 negara mulai dari Afganistan hingga Zimbabwe. Seluruh sel diisi dengan bilangan bulat yang menyatakan jumlah kumlatif total orang yang meninggal per harinya, bilangan desimal untuk menunjukan lat dan long sebuah negara, serta string untuk menunjukan nama kota/provinsi dan nama negara. Data set "raw_data_deaths" memiliki data yang yang hilang yaitu pada kolom Province/State, namun hal ini tidak terlalu penting dikarenakan pengamatan hanya memusatkan pada variabel Country/Region. Adanya missing value dibuktikan melalui method .info yang menyatakan bahwa terdapat nilai non null pada kolom Province/State sebanyal 83 sel, sedangkan untuk tanggal perharinya semua sel terisi penuh.

Selanjutnya, tampilkan beberapa baris teratas/terbawah data kasus kematian COVID-19 di setiap negara yang terindeks berdasarkan waktu(date/time) bukan berdasarkan Country/Region.

In [26]:
deaths = raw_data_deaths.melt(id_vars=['Province/State','Country/Region','Lat','Long'],
                                            value_vars=raw_data_deaths.iloc[:,4:],
                                            var_name='Date', value_name='Total Pasien Meninggal')

deaths["Date"] = pd.to_datetime(deaths["Date"])

deaths = deaths.drop(["Province/State","Lat","Long"], axis = 1)
deaths = deaths.groupby(['Date','Country/Region'],as_index=False).agg({'Total Pasien Meninggal': 'sum'})
deaths = deaths.pivot_table(index=['Date'], columns='Country/Region',
                     values='Total Pasien Meninggal', aggfunc='first').reset_index()

deaths = deaths.set_index(['Date'])
In [27]:
pd.set_option('display.max_columns', None)
deaths.head()
Out[27]:
Country/Region Afghanistan Albania Algeria Andorra Angola Antigua and Barbuda Argentina Armenia Australia Austria Azerbaijan Bahamas Bahrain Bangladesh Barbados Belarus Belgium Belize Benin Bhutan Bolivia Bosnia and Herzegovina Botswana Brazil Brunei Bulgaria Burkina Faso Burma Burundi Cabo Verde Cambodia Cameroon Canada Central African Republic Chad Chile China Colombia Congo (Brazzaville) Congo (Kinshasa) Costa Rica Cote d'Ivoire Croatia Cuba Cyprus Czechia Denmark Diamond Princess Djibouti Dominica Dominican Republic Ecuador Egypt El Salvador Equatorial Guinea Eritrea Estonia Eswatini Ethiopia Fiji Finland France Gabon Gambia Georgia Germany Ghana Greece Grenada Guatemala Guinea Guinea-Bissau Guyana Haiti Holy See Honduras Hungary Iceland India Indonesia Iran Iraq Ireland Israel Italy Jamaica Japan Jordan Kazakhstan Kenya Korea, South Kosovo Kuwait Kyrgyzstan Laos Latvia Lebanon Liberia Libya Liechtenstein Lithuania Luxembourg MS Zaandam Madagascar Malawi Malaysia Maldives Mali Malta Mauritania Mauritius Mexico Moldova Monaco Mongolia Montenegro Morocco Mozambique Namibia Nepal Netherlands New Zealand Nicaragua Niger Nigeria North Macedonia Norway Oman Pakistan Panama Papua New Guinea Paraguay Peru Philippines Poland Portugal Qatar Romania Russia Rwanda Saint Kitts and Nevis Saint Lucia Saint Vincent and the Grenadines San Marino Sao Tome and Principe Saudi Arabia Senegal Serbia Seychelles Sierra Leone Singapore Slovakia Slovenia Somalia South Africa South Sudan Spain Sri Lanka Sudan Suriname Sweden Switzerland Syria Taiwan* Tanzania Thailand Timor-Leste Togo Trinidad and Tobago Tunisia Turkey US Uganda Ukraine United Arab Emirates United Kingdom Uruguay Uzbekistan Venezuela Vietnam West Bank and Gaza Western Sahara Zambia Zimbabwe
Date
2020-01-22 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 17 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
2020-01-23 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 18 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
2020-01-24 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 26 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
2020-01-25 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 42 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
2020-01-26 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 56 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
In [28]:
pd.set_option('display.max_columns', None)
deaths.tail()
Out[28]:
Country/Region Afghanistan Albania Algeria Andorra Angola Antigua and Barbuda Argentina Armenia Australia Austria Azerbaijan Bahamas Bahrain Bangladesh Barbados Belarus Belgium Belize Benin Bhutan Bolivia Bosnia and Herzegovina Botswana Brazil Brunei Bulgaria Burkina Faso Burma Burundi Cabo Verde Cambodia Cameroon Canada Central African Republic Chad Chile China Colombia Congo (Brazzaville) Congo (Kinshasa) Costa Rica Cote d'Ivoire Croatia Cuba Cyprus Czechia Denmark Diamond Princess Djibouti Dominica Dominican Republic Ecuador Egypt El Salvador Equatorial Guinea Eritrea Estonia Eswatini Ethiopia Fiji Finland France Gabon Gambia Georgia Germany Ghana Greece Grenada Guatemala Guinea Guinea-Bissau Guyana Haiti Holy See Honduras Hungary Iceland India Indonesia Iran Iraq Ireland Israel Italy Jamaica Japan Jordan Kazakhstan Kenya Korea, South Kosovo Kuwait Kyrgyzstan Laos Latvia Lebanon Liberia Libya Liechtenstein Lithuania Luxembourg MS Zaandam Madagascar Malawi Malaysia Maldives Mali Malta Mauritania Mauritius Mexico Moldova Monaco Mongolia Montenegro Morocco Mozambique Namibia Nepal Netherlands New Zealand Nicaragua Niger Nigeria North Macedonia Norway Oman Pakistan Panama Papua New Guinea Paraguay Peru Philippines Poland Portugal Qatar Romania Russia Rwanda Saint Kitts and Nevis Saint Lucia Saint Vincent and the Grenadines San Marino Sao Tome and Principe Saudi Arabia Senegal Serbia Seychelles Sierra Leone Singapore Slovakia Slovenia Somalia South Africa South Sudan Spain Sri Lanka Sudan Suriname Sweden Switzerland Syria Taiwan* Tanzania Thailand Timor-Leste Togo Trinidad and Tobago Tunisia Turkey US Uganda Ukraine United Arab Emirates United Kingdom Uruguay Uzbekistan Venezuela Vietnam West Bank and Gaza Western Sahara Zambia Zimbabwe
Date
2020-04-03 6 17 105 16 2 0 39 7 28 168 5 1 4 6 0 4 1143 0 0 0 9 17 1 359 1 14 16 1 0 1 0 8 179 0 0 22 3326 25 2 13 2 1 8 6 11 53 139 11 0 0 68 145 66 2 0 0 12 0 0 0 20 6520 1 1 0 1275 5 63 0 1 0 0 4 0 0 15 26 4 72 181 3294 54 120 40 14681 3 63 5 6 4 174 1 0 1 0 1 17 0 1 0 9 31 2 0 0 53 0 3 0 1 7 50 8 1 0 2 48 0 0 0 1490 1 1 5 4 12 59 1 40 37 0 3 61 136 71 246 3 133 34 0 0 0 0 30 0 25 1 39 0 0 5 1 20 0 9 0 11198 4 2 1 358 591 2 5 1 19 0 3 6 18 425 7087 0 27 9 3611 4 2 7 0 1 0 1 1
2020-04-04 7 20 130 17 2 0 43 7 30 186 5 4 4 8 0 5 1283 0 0 0 10 21 1 445 1 17 16 1 0 1 0 9 218 0 0 27 3330 32 2 18 2 1 12 6 11 59 161 11 0 0 68 172 71 3 0 0 13 0 0 0 25 7574 1 1 1 1444 5 68 0 2 0 0 4 0 0 15 32 4 86 191 3452 56 137 44 15362 3 77 5 5 4 177 1 1 1 0 1 17 1 1 1 11 31 2 0 0 57 0 3 0 1 7 60 12 1 0 2 59 0 0 0 1656 1 1 8 4 17 62 2 41 41 0 3 73 144 79 266 3 146 43 0 0 0 0 32 0 29 2 44 0 0 6 1 22 0 9 0 11947 5 2 1 373 666 2 5 1 20 0 3 6 18 501 8407 0 32 10 4320 5 2 7 0 1 0 1 1
2020-04-05 7 20 152 18 2 0 44 7 35 204 7 4 4 9 1 8 1447 0 0 0 10 23 1 486 1 20 17 1 0 1 0 9 259 0 0 34 3333 35 5 18 2 3 15 8 9 67 179 11 0 0 82 180 78 3 0 0 15 0 2 0 28 8093 1 1 2 1584 5 73 0 2 0 0 4 1 0 22 34 4 99 198 3603 61 158 49 15887 3 77 5 6 4 183 1 1 1 0 1 18 3 1 1 13 36 2 0 0 61 0 5 0 1 7 79 15 1 0 2 70 0 0 0 1771 1 1 10 5 18 71 2 47 46 0 3 83 152 94 295 4 151 45 0 0 0 0 32 0 34 2 51 0 0 6 1 28 0 11 0 12641 5 2 1 401 715 2 5 1 23 0 3 7 22 574 9619 0 37 10 4943 5 2 7 0 1 0 1 1
2020-04-06 11 21 173 21 2 0 48 8 40 220 7 5 4 12 2 13 1632 1 1 0 11 29 1 564 1 22 18 1 0 1 0 9 339 0 0 37 3335 46 5 18 2 3 16 9 9 78 187 11 0 0 86 191 85 4 0 0 19 0 2 0 27 8926 1 1 2 1810 5 79 0 3 0 0 4 1 0 22 38 6 136 209 3739 64 174 57 16523 3 85 6 6 6 186 1 1 4 0 1 19 3 1 1 15 41 2 0 0 62 0 5 0 1 7 94 19 1 0 2 80 0 0 0 1874 1 1 10 5 23 76 2 53 54 0 5 92 163 107 311 4 176 47 0 0 0 0 32 0 38 2 58 0 0 6 2 30 0 12 0 13341 5 2 1 477 765 2 5 1 26 0 3 8 22 649 10783 0 38 11 5385 6 2 7 0 1 0 1 1
2020-04-07 14 22 193 22 2 1 56 8 45 243 8 6 5 17 3 13 2035 1 1 0 14 33 1 686 1 23 19 1 0 1 0 9 375 0 0 43 3335 50 5 18 2 3 18 11 9 88 203 11 0 0 98 191 94 4 0 0 21 0 2 0 34 10343 1 1 3 2016 5 81 0 3 0 0 5 1 0 22 47 6 150 221 3872 65 210 65 17127 3 92 6 6 6 192 4 1 4 0 2 19 3 1 1 15 44 2 0 1 63 0 5 0 1 7 125 22 1 0 2 90 0 0 0 2108 1 1 11 6 26 89 2 57 55 0 5 107 177 129 345 6 197 58 0 0 0 0 34 0 41 2 61 0 0 6 2 36 0 13 0 14045 6 2 1 591 821 2 5 1 27 0 3 8 23 725 12722 0 45 12 6171 7 2 7 0 1 0 1 2
In [29]:
deaths.index
Out[29]:
DatetimeIndex(['2020-01-22', '2020-01-23', '2020-01-24', '2020-01-25',
               '2020-01-26', '2020-01-27', '2020-01-28', '2020-01-29',
               '2020-01-30', '2020-01-31', '2020-02-01', '2020-02-02',
               '2020-02-03', '2020-02-04', '2020-02-05', '2020-02-06',
               '2020-02-07', '2020-02-08', '2020-02-09', '2020-02-10',
               '2020-02-11', '2020-02-12', '2020-02-13', '2020-02-14',
               '2020-02-15', '2020-02-16', '2020-02-17', '2020-02-18',
               '2020-02-19', '2020-02-20', '2020-02-21', '2020-02-22',
               '2020-02-23', '2020-02-24', '2020-02-25', '2020-02-26',
               '2020-02-27', '2020-02-28', '2020-02-29', '2020-03-01',
               '2020-03-02', '2020-03-03', '2020-03-04', '2020-03-05',
               '2020-03-06', '2020-03-07', '2020-03-08', '2020-03-09',
               '2020-03-10', '2020-03-11', '2020-03-12', '2020-03-13',
               '2020-03-14', '2020-03-15', '2020-03-16', '2020-03-17',
               '2020-03-18', '2020-03-19', '2020-03-20', '2020-03-21',
               '2020-03-22', '2020-03-23', '2020-03-24', '2020-03-25',
               '2020-03-26', '2020-03-27', '2020-03-28', '2020-03-29',
               '2020-03-30', '2020-03-31', '2020-04-01', '2020-04-02',
               '2020-04-03', '2020-04-04', '2020-04-05', '2020-04-06',
               '2020-04-07'],
              dtype='datetime64[ns]', name='Date', freq=None)
In [30]:
pd.set_option('display.max_columns', None)
deaths.describe()
Out[30]:
Country/Region Afghanistan Albania Algeria Andorra Angola Antigua and Barbuda Argentina Armenia Australia Austria Azerbaijan Bahamas Bahrain Bangladesh Barbados Belarus Belgium Belize Benin Bhutan Bolivia Bosnia and Herzegovina Botswana Brazil Brunei Bulgaria Burkina Faso Burma Burundi Cabo Verde Cambodia Cameroon Canada Central African Republic Chad Chile China Colombia Congo (Brazzaville) Congo (Kinshasa) Costa Rica Cote d'Ivoire Croatia Cuba Cyprus Czechia Denmark Diamond Princess Djibouti Dominica Dominican Republic Ecuador Egypt El Salvador Equatorial Guinea Eritrea Estonia Eswatini Ethiopia Fiji Finland France Gabon Gambia Georgia Germany Ghana Greece Grenada Guatemala Guinea Guinea-Bissau Guyana Haiti Holy See Honduras Hungary Iceland India Indonesia Iran Iraq Ireland Israel Italy Jamaica Japan Jordan Kazakhstan Kenya Korea, South Kosovo Kuwait Kyrgyzstan Laos Latvia Lebanon Liberia Libya Liechtenstein Lithuania Luxembourg MS Zaandam Madagascar Malawi Malaysia Maldives Mali Malta Mauritania Mauritius Mexico Moldova Monaco Mongolia Montenegro Morocco Mozambique Namibia Nepal Netherlands New Zealand Nicaragua Niger Nigeria North Macedonia Norway Oman Pakistan Panama Papua New Guinea Paraguay Peru Philippines Poland Portugal Qatar Romania Russia Rwanda Saint Kitts and Nevis Saint Lucia Saint Vincent and the Grenadines San Marino Sao Tome and Principe Saudi Arabia Senegal Serbia Seychelles Sierra Leone Singapore Slovakia Slovenia Somalia South Africa South Sudan Spain Sri Lanka Sudan Suriname Sweden Switzerland Syria Taiwan* Tanzania Thailand Timor-Leste Togo Trinidad and Tobago Tunisia Turkey US Uganda Ukraine United Arab Emirates United Kingdom Uruguay Uzbekistan Venezuela Vietnam West Bank and Gaza Western Sahara Zambia Zimbabwe
count 77.000000 77.000000 77.000000 77.000000 77.00000 77.000000 77.000000 77.000000 77.000000 77.000000 77.000000 77.000000 77.000000 77.000000 77.000000 77.000000 77.000000 77.000000 77.000000 77.0 77.000000 77.000000 77.000000 77.000000 77.000000 77.000000 77.000000 77.000000 77.0 77.000000 77.0 77.000000 77.000000 77.0 77.0 77.000000 77.000000 77.000000 77.000000 77.000000 77.000000 77.000000 77.000000 77.000000 77.000000 77.000000 77.000000 77.000000 77.0 77.0 77.000000 77.000000 77.000000 77.000000 77.0 77.0 77.000000 77.0 77.000000 77.0 77.000000 77.000000 77.000000 77.000000 77.000000 77.000000 77.000000 77.000000 77.0 77.000000 77.0 77.0 77.000000 77.000000 77.0 77.000000 77.000000 77.000000 77.000000 77.000000 77.000000 77.000000 77.000000 77.000000 77.000000 77.000000 77.000000 77.000000 77.000000 77.000000 77.000000 77.000000 77.000000 77.000000 77.0 77.000000 77.000000 77.000000 77.000000 77.000000 77.000000 77.000000 77.000000 77.0 77.000000 77.000000 77.0 77.000000 77.0 77.000000 77.000000 77.000000 77.000000 77.000000 77.0 77.000000 77.000000 77.0 77.0 77.0 77.000000 77.000000 77.000000 77.000000 77.000000 77.000000 77.000000 77.000000 77.000000 77.000000 77.0 77.000000 77.000000 77.000000 77.000000 77.000000 77.000000 77.000000 77.000000 77.0 77.0 77.0 77.0 77.000000 77.0 77.000000 77.000000 77.000000 77.0 77.0 77.000000 77.000000 77.000000 77.0 77.000000 77.0 77.000000 77.000000 77.000000 77.000000 77.000000 77.000000 77.000000 77.000000 77.000000 77.000000 77.0 77.000000 77.000000 77.000000 77.000000 77.000000 77.0 77.000000 77.000000 77.000000 77.000000 77.000000 77.000000 77.0 77.000000 77.0 77.000000 77.000000
mean 1.090909 2.883117 15.857143 2.103896 0.25974 0.012987 5.870130 0.779221 5.350649 25.337662 1.025974 0.285714 0.909091 1.467532 0.077922 0.649351 162.649351 0.025974 0.025974 0.0 1.038961 2.623377 0.103896 52.987013 0.142857 2.428571 2.649351 0.103896 0.0 0.194805 0.0 1.051948 28.337662 0.0 0.0 3.207792 2195.987013 3.792208 0.272727 1.922078 0.493506 0.207792 1.532468 1.038961 1.415584 6.987013 21.272727 4.493506 0.0 0.0 9.597403 19.675325 10.935065 0.259740 0.0 0.0 1.428571 0.0 0.077922 0.0 3.103896 938.259740 0.246753 0.207792 0.103896 182.233766 0.948052 10.467532 0.0 0.376623 0.0 0.0 0.623377 0.038961 0.0 1.818182 4.376623 0.740260 11.675325 30.077922 760.090909 11.883117 16.597403 5.337662 2898.428571 0.441558 17.766234 0.675325 0.584416 0.441558 51.103896 0.207792 0.051948 0.142857 0.0 0.077922 2.987013 0.129870 0.077922 0.051948 1.649351 5.246753 0.181818 0.0 0.012987 8.506494 0.0 0.415584 0.0 0.116883 0.961039 7.558442 1.402597 0.129870 0.0 0.311688 8.077922 0.0 0.0 0.0 224.051948 0.129870 0.155844 0.844156 0.506494 2.051948 8.896104 0.155844 5.532468 5.597403 0.0 0.662338 8.454545 21.714286 10.298701 34.428571 0.389610 17.194805 4.350649 0.0 0.0 0.0 0.0 6.935065 0.0 3.155844 0.142857 4.974026 0.0 0.0 0.792208 0.168831 3.259740 0.0 0.987013 0.0 1785.532468 0.493506 0.454545 0.064935 47.948052 92.831169 0.246753 1.272727 0.103896 2.779221 0.0 0.311688 0.792208 2.506494 58.220779 1006.480519 0.0 4.025974 1.298701 504.350649 0.467532 0.298701 0.701299 0.0 0.168831 0.0 0.077922 0.220779
std 2.601527 5.842165 39.367939 5.317757 0.67673 0.113961 12.855831 2.062340 9.753227 58.164832 1.946481 1.086486 1.590943 3.101716 0.421970 2.382868 410.243534 0.160101 0.160101 0.0 2.993157 6.747395 0.307127 136.538263 0.352222 5.115581 5.457410 0.307127 0.0 0.398648 0.0 2.579760 72.880510 0.0 0.0 8.680495 1230.823820 10.051627 1.034107 4.672896 0.852602 0.635313 3.761244 2.330809 3.096478 18.631110 48.073583 4.099497 0.0 0.0 22.960641 47.113089 22.431966 0.849188 0.0 0.0 4.240868 0.0 0.389542 0.0 7.564781 2222.204604 0.433949 0.408388 0.475295 442.151674 1.863049 20.997233 0.0 0.669622 0.0 0.0 1.158935 0.194771 0.0 5.197994 9.694055 1.454599 29.528952 59.599048 1172.063017 19.207985 43.007423 13.793220 4995.124788 0.895802 24.560289 1.712505 1.533406 1.261719 62.276671 0.569803 0.223377 0.663212 0.0 0.314820 5.285266 0.592733 0.269807 0.223377 3.684128 10.821708 0.578730 0.0 0.113961 17.737578 0.0 1.184890 0.0 0.323388 2.086558 21.871932 4.020539 0.338365 0.0 0.654131 19.222907 0.0 0.0 0.0 500.221816 0.338365 0.365086 2.373455 1.263072 5.253811 19.657986 0.488417 13.044039 13.018468 0.0 1.313997 22.150529 42.810125 25.412940 81.435869 1.113976 43.882930 12.091500 0.0 0.0 0.0 0.0 10.802458 0.0 8.843768 0.478877 13.478027 0.0 0.0 1.641066 0.441367 7.510348 0.0 2.835366 0.0 3709.589382 1.372890 0.698597 0.248027 119.254471 200.849669 0.652038 1.509935 0.307127 6.103544 0.0 0.815310 1.962394 5.651323 152.829336 2594.091807 0.0 9.598484 2.924780 1293.356433 1.438058 0.708314 1.878304 0.0 0.377059 0.0 0.269807 0.447901
min 0.000000 0.000000 0.000000 0.000000 0.00000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.0 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.0 0.000000 0.0 0.000000 0.000000 0.0 0.0 0.000000 17.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.0 0.0 0.000000 0.000000 0.000000 0.000000 0.0 0.0 0.000000 0.0 0.000000 0.0 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.0 0.000000 0.0 0.0 0.000000 0.000000 0.0 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.0 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.0 0.000000 0.000000 0.0 0.000000 0.0 0.000000 0.000000 0.000000 0.000000 0.000000 0.0 0.000000 0.000000 0.0 0.0 0.0 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.0 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.0 0.0 0.0 0.0 0.000000 0.0 0.000000 0.000000 0.000000 0.0 0.0 0.000000 0.000000 0.000000 0.0 0.000000 0.0 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.0 0.000000 0.000000 0.000000 0.000000 0.000000 0.0 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.0 0.000000 0.0 0.000000 0.000000
25% 0.000000 0.000000 0.000000 0.000000 0.00000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.0 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.0 0.000000 0.0 0.000000 0.000000 0.0 0.0 0.000000 1012.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.0 0.0 0.000000 0.000000 0.000000 0.000000 0.0 0.0 0.000000 0.0 0.000000 0.0 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.0 0.000000 0.0 0.0 0.000000 0.000000 0.0 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.0 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.0 0.000000 0.000000 0.0 0.000000 0.0 0.000000 0.000000 0.000000 0.000000 0.000000 0.0 0.000000 0.000000 0.0 0.0 0.0 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.0 0.000000 0.000000 1.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.0 0.0 0.0 0.0 0.000000 0.0 0.000000 0.000000 0.000000 0.0 0.0 0.000000 0.000000 0.000000 0.0 0.000000 0.0 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.0 0.000000 0.000000 0.000000 0.000000 0.000000 0.0 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.0 0.000000 0.0 0.000000 0.000000
50% 0.000000 0.000000 0.000000 0.000000 0.00000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.0 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.0 0.000000 0.0 0.000000 0.000000 0.0 0.0 0.000000 2837.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 6.000000 0.0 0.0 0.000000 0.000000 0.000000 0.000000 0.0 0.0 0.000000 0.0 0.000000 0.0 0.000000 2.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.0 0.000000 0.0 0.0 0.000000 0.000000 0.0 0.000000 0.000000 0.000000 0.000000 0.000000 43.000000 0.000000 0.000000 0.000000 29.000000 0.000000 5.000000 0.000000 0.000000 0.000000 16.000000 0.000000 0.000000 0.000000 0.0 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.0 0.000000 0.000000 0.0 0.000000 0.0 0.000000 0.000000 0.000000 0.000000 0.000000 0.0 0.000000 0.000000 0.0 0.0 0.0 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.0 0.000000 0.000000 1.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.0 0.0 0.0 0.0 0.000000 0.0 0.000000 0.000000 0.000000 0.0 0.0 0.000000 0.000000 0.000000 0.0 0.000000 0.0 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 1.000000 0.000000 0.000000 0.0 0.000000 0.000000 0.000000 0.000000 1.000000 0.0 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.0 0.000000 0.0 0.000000 0.000000
75% 0.000000 2.000000 9.000000 0.000000 0.00000 0.000000 3.000000 0.000000 6.000000 6.000000 1.000000 0.000000 1.000000 1.000000 0.000000 0.000000 21.000000 0.000000 0.000000 0.0 0.000000 0.000000 0.000000 6.000000 0.000000 3.000000 1.000000 0.000000 0.0 0.000000 0.0 0.000000 9.000000 0.0 0.0 0.000000 3249.000000 0.000000 0.000000 0.000000 1.000000 0.000000 1.000000 1.000000 0.000000 0.000000 6.000000 7.000000 0.0 0.0 2.000000 3.000000 6.000000 0.000000 0.0 0.0 0.000000 0.0 0.000000 0.0 0.000000 244.000000 0.000000 0.000000 0.000000 44.000000 0.000000 6.000000 0.0 1.000000 0.0 0.0 1.000000 0.000000 0.0 0.000000 1.000000 1.000000 4.000000 25.000000 1284.000000 13.000000 3.000000 0.000000 3405.000000 1.000000 29.000000 0.000000 0.000000 0.000000 91.000000 0.000000 0.000000 0.000000 0.0 0.000000 4.000000 0.000000 0.000000 0.000000 0.000000 4.000000 0.000000 0.0 0.000000 2.000000 0.0 0.000000 0.0 0.000000 0.000000 1.000000 1.000000 0.000000 0.0 0.000000 2.000000 0.0 0.0 0.0 77.000000 0.000000 0.000000 0.000000 0.000000 0.000000 7.000000 0.000000 2.000000 1.000000 0.0 0.000000 0.000000 18.000000 5.000000 3.000000 0.000000 0.000000 1.000000 0.0 0.0 0.0 0.0 11.000000 0.0 0.000000 0.000000 0.000000 0.0 0.0 0.000000 0.000000 1.000000 0.0 0.000000 0.0 830.000000 0.000000 1.000000 0.000000 11.000000 41.000000 0.000000 1.000000 0.000000 1.000000 0.0 0.000000 0.000000 1.000000 3.000000 200.000000 0.0 2.000000 0.000000 138.000000 0.000000 0.000000 0.000000 0.0 0.000000 0.0 0.000000 0.000000
max 14.000000 22.000000 193.000000 22.000000 2.00000 1.000000 56.000000 8.000000 45.000000 243.000000 8.000000 6.000000 5.000000 17.000000 3.000000 13.000000 2035.000000 1.000000 1.000000 0.0 14.000000 33.000000 1.000000 686.000000 1.000000 23.000000 19.000000 1.000000 0.0 1.000000 0.0 9.000000 375.000000 0.0 0.0 43.000000 3335.000000 50.000000 5.000000 18.000000 2.000000 3.000000 18.000000 11.000000 11.000000 88.000000 203.000000 11.000000 0.0 0.0 98.000000 191.000000 94.000000 4.000000 0.0 0.0 21.000000 0.0 2.000000 0.0 34.000000 10343.000000 1.000000 1.000000 3.000000 2016.000000 5.000000 81.000000 0.0 3.000000 0.0 0.0 5.000000 1.000000 0.0 22.000000 47.000000 6.000000 150.000000 221.000000 3872.000000 65.000000 210.000000 65.000000 17127.000000 3.000000 92.000000 6.000000 6.000000 6.000000 192.000000 4.000000 1.000000 4.000000 0.0 2.000000 19.000000 3.000000 1.000000 1.000000 15.000000 44.000000 2.000000 0.0 1.000000 63.000000 0.0 5.000000 0.0 1.000000 7.000000 125.000000 22.000000 1.000000 0.0 2.000000 90.000000 0.0 0.0 0.0 2108.000000 1.000000 1.000000 11.000000 6.000000 26.000000 89.000000 2.000000 57.000000 55.000000 0.0 5.000000 107.000000 177.000000 129.000000 345.000000 6.000000 197.000000 58.000000 0.0 0.0 0.0 0.0 34.000000 0.0 41.000000 2.000000 61.000000 0.0 0.0 6.000000 2.000000 36.000000 0.0 13.000000 0.0 14045.000000 6.000000 2.000000 1.000000 591.000000 821.000000 2.000000 5.000000 1.000000 27.000000 0.0 3.000000 8.000000 23.000000 725.000000 12722.000000 0.0 45.000000 12.000000 6171.000000 7.000000 2.000000 7.000000 0.0 1.000000 0.0 1.000000 2.000000
In [31]:
print("Kasus terkecil namun paling tinggi:", deaths.min().max())
print("Nilai tertinggi dan paling besar nilainya diantara yang lain: ",deaths.max().max())
Kasus terkecil namun paling tinggi: 17
Nilai tertinggi dan paling besar nilainya diantara yang lain:  17127

Berdasarkan tabel-tabel diatas didapatkan juga informasi sebagai berikut:

  • Kasus kematian terkecil namun paling besar diantara negara-negara ialah Cina yakni sebanyak 17 kasus kematian pada tanggal 22 Januari 2020.
  • Per tangga 7 April 2020, kasus kematian terbanyak ialah berasal dari negara Italy, dimana pada tanggal 7 April jumlah kasus kematian mencapai 17.127 kasus, sedangkan negara China, di akhir periode hanya memiliki kasus kematian sebanyak 3.335 kasus.
  • Mulai dari periode 22 Januari 2020 sampai 7 April 2020 terdapat beberapa negara yang tidak memiliki kasus kematian, di antranya:
    1. Bhutan                                            21.Nepal
    2. Burundi                                           22.Nimbia
    3. Cambodia                                          23.Mozambique
    4. Chad                                              24.Papua New Guniea
    5. Central African Republic                          25.Rwanda 
    6. Dominica                                          26.Saint Kitts and Nevis
    7. Djibouti                                          27.Saint Lucia
    8. Equatriorial Guniea                               28.Saint Vincent and the Grenadines
    9. Eritrea                                           29.Sao Tome and Principe
    10.Eswatini                                          30.Sierra Leone
    11.Fiji                                              31.Seychelles
    12.Grenada                                           32.Somalia
    13.Guinea                                            33.South Sudan
    14.Guinea-Bissau                                     34.Timor Leste
    15.Holy See                                          35.Uganda
    16.Laos                                              36.Vietnam
    17.Madagascar                                        37.Western Sahara
    18.Maldives
    19.Malta
    20.Mongolia

4. Penyelarasan kurva pertumbuhan seluruh negara dengan jumlah kasus kematian COVID-19 ≥ 25 (Bobot: 25%)¶

Untuk mendapatkan gambaran perkembangan kasus covid-19 di berbagai negara, diperlukan penyelarasan kurva pertumbuhan setiap negara. Kurva hanya menampilkan informasi yang dimulai dengan hari dimana data kasus kematian COVID-19 setidaknya 25 orang.

In [32]:
deaths = raw_data_deaths.melt(id_vars=['Province/State','Country/Region','Lat','Long'],
                                            value_vars=raw_data_deaths.iloc[:,4:],
                                            var_name='Date', value_name='Total Pasien Meninggal')

deaths["Date"] = pd.to_datetime(deaths["Date"])

deaths = deaths.drop(["Province/State","Lat","Long"], axis = 1)
deaths = deaths.groupby(['Date','Country/Region'],as_index=False).agg({'Total Pasien Meninggal': 'sum'})
deaths = deaths.pivot_table(index=['Date'], columns='Country/Region',
                     values='Total Pasien Meninggal', aggfunc='first').reset_index()

deaths = deaths.set_index(['Date'])
deaths
Out[32]:
Country/Region Afghanistan Albania Algeria Andorra Angola Antigua and Barbuda Argentina Armenia Australia Austria Azerbaijan Bahamas Bahrain Bangladesh Barbados Belarus Belgium Belize Benin Bhutan Bolivia Bosnia and Herzegovina Botswana Brazil Brunei Bulgaria Burkina Faso Burma Burundi Cabo Verde Cambodia Cameroon Canada Central African Republic Chad Chile China Colombia Congo (Brazzaville) Congo (Kinshasa) Costa Rica Cote d'Ivoire Croatia Cuba Cyprus Czechia Denmark Diamond Princess Djibouti Dominica Dominican Republic Ecuador Egypt El Salvador Equatorial Guinea Eritrea Estonia Eswatini Ethiopia Fiji Finland France Gabon Gambia Georgia Germany Ghana Greece Grenada Guatemala Guinea Guinea-Bissau Guyana Haiti Holy See Honduras Hungary Iceland India Indonesia Iran Iraq Ireland Israel Italy Jamaica Japan Jordan Kazakhstan Kenya Korea, South Kosovo Kuwait Kyrgyzstan Laos Latvia Lebanon Liberia Libya Liechtenstein Lithuania Luxembourg MS Zaandam Madagascar Malawi Malaysia Maldives Mali Malta Mauritania Mauritius Mexico Moldova Monaco Mongolia Montenegro Morocco Mozambique Namibia Nepal Netherlands New Zealand Nicaragua Niger Nigeria North Macedonia Norway Oman Pakistan Panama Papua New Guinea Paraguay Peru Philippines Poland Portugal Qatar Romania Russia Rwanda Saint Kitts and Nevis Saint Lucia Saint Vincent and the Grenadines San Marino Sao Tome and Principe Saudi Arabia Senegal Serbia Seychelles Sierra Leone Singapore Slovakia Slovenia Somalia South Africa South Sudan Spain Sri Lanka Sudan Suriname Sweden Switzerland Syria Taiwan* Tanzania Thailand Timor-Leste Togo Trinidad and Tobago Tunisia Turkey US Uganda Ukraine United Arab Emirates United Kingdom Uruguay Uzbekistan Venezuela Vietnam West Bank and Gaza Western Sahara Zambia Zimbabwe
Date
2020-01-22 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 17 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
2020-01-23 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 18 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
2020-01-24 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 26 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
2020-01-25 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 42 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
2020-01-26 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 56 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ...
2020-04-03 6 17 105 16 2 0 39 7 28 168 5 1 4 6 0 4 1143 0 0 0 9 17 1 359 1 14 16 1 0 1 0 8 179 0 0 22 3326 25 2 13 2 1 8 6 11 53 139 11 0 0 68 145 66 2 0 0 12 0 0 0 20 6520 1 1 0 1275 5 63 0 1 0 0 4 0 0 15 26 4 72 181 3294 54 120 40 14681 3 63 5 6 4 174 1 0 1 0 1 17 0 1 0 9 31 2 0 0 53 0 3 0 1 7 50 8 1 0 2 48 0 0 0 1490 1 1 5 4 12 59 1 40 37 0 3 61 136 71 246 3 133 34 0 0 0 0 30 0 25 1 39 0 0 5 1 20 0 9 0 11198 4 2 1 358 591 2 5 1 19 0 3 6 18 425 7087 0 27 9 3611 4 2 7 0 1 0 1 1
2020-04-04 7 20 130 17 2 0 43 7 30 186 5 4 4 8 0 5 1283 0 0 0 10 21 1 445 1 17 16 1 0 1 0 9 218 0 0 27 3330 32 2 18 2 1 12 6 11 59 161 11 0 0 68 172 71 3 0 0 13 0 0 0 25 7574 1 1 1 1444 5 68 0 2 0 0 4 0 0 15 32 4 86 191 3452 56 137 44 15362 3 77 5 5 4 177 1 1 1 0 1 17 1 1 1 11 31 2 0 0 57 0 3 0 1 7 60 12 1 0 2 59 0 0 0 1656 1 1 8 4 17 62 2 41 41 0 3 73 144 79 266 3 146 43 0 0 0 0 32 0 29 2 44 0 0 6 1 22 0 9 0 11947 5 2 1 373 666 2 5 1 20 0 3 6 18 501 8407 0 32 10 4320 5 2 7 0 1 0 1 1
2020-04-05 7 20 152 18 2 0 44 7 35 204 7 4 4 9 1 8 1447 0 0 0 10 23 1 486 1 20 17 1 0 1 0 9 259 0 0 34 3333 35 5 18 2 3 15 8 9 67 179 11 0 0 82 180 78 3 0 0 15 0 2 0 28 8093 1 1 2 1584 5 73 0 2 0 0 4 1 0 22 34 4 99 198 3603 61 158 49 15887 3 77 5 6 4 183 1 1 1 0 1 18 3 1 1 13 36 2 0 0 61 0 5 0 1 7 79 15 1 0 2 70 0 0 0 1771 1 1 10 5 18 71 2 47 46 0 3 83 152 94 295 4 151 45 0 0 0 0 32 0 34 2 51 0 0 6 1 28 0 11 0 12641 5 2 1 401 715 2 5 1 23 0 3 7 22 574 9619 0 37 10 4943 5 2 7 0 1 0 1 1
2020-04-06 11 21 173 21 2 0 48 8 40 220 7 5 4 12 2 13 1632 1 1 0 11 29 1 564 1 22 18 1 0 1 0 9 339 0 0 37 3335 46 5 18 2 3 16 9 9 78 187 11 0 0 86 191 85 4 0 0 19 0 2 0 27 8926 1 1 2 1810 5 79 0 3 0 0 4 1 0 22 38 6 136 209 3739 64 174 57 16523 3 85 6 6 6 186 1 1 4 0 1 19 3 1 1 15 41 2 0 0 62 0 5 0 1 7 94 19 1 0 2 80 0 0 0 1874 1 1 10 5 23 76 2 53 54 0 5 92 163 107 311 4 176 47 0 0 0 0 32 0 38 2 58 0 0 6 2 30 0 12 0 13341 5 2 1 477 765 2 5 1 26 0 3 8 22 649 10783 0 38 11 5385 6 2 7 0 1 0 1 1
2020-04-07 14 22 193 22 2 1 56 8 45 243 8 6 5 17 3 13 2035 1 1 0 14 33 1 686 1 23 19 1 0 1 0 9 375 0 0 43 3335 50 5 18 2 3 18 11 9 88 203 11 0 0 98 191 94 4 0 0 21 0 2 0 34 10343 1 1 3 2016 5 81 0 3 0 0 5 1 0 22 47 6 150 221 3872 65 210 65 17127 3 92 6 6 6 192 4 1 4 0 2 19 3 1 1 15 44 2 0 1 63 0 5 0 1 7 125 22 1 0 2 90 0 0 0 2108 1 1 11 6 26 89 2 57 55 0 5 107 177 129 345 6 197 58 0 0 0 0 34 0 41 2 61 0 0 6 2 36 0 13 0 14045 6 2 1 591 821 2 5 1 27 0 3 8 23 725 12722 0 45 12 6171 7 2 7 0 1 0 1 2

77 rows × 184 columns

In [33]:
pd.set_option('display.max_columns', None)
kurangdaridualima = deaths[-1:].squeeze() >= 25
x = deaths.loc[:, kurangdaridualima]
death = pd.DataFrame(x)
death
Out[33]:
Country/Region Algeria Argentina Australia Austria Belgium Bosnia and Herzegovina Brazil Canada Chile China Colombia Czechia Denmark Dominican Republic Ecuador Egypt Finland France Germany Greece Hungary India Indonesia Iran Iraq Ireland Israel Italy Japan Korea, South Luxembourg Malaysia Mexico Morocco Netherlands North Macedonia Norway Pakistan Panama Peru Philippines Poland Portugal Romania Russia San Marino Saudi Arabia Serbia Slovenia Spain Sweden Switzerland Thailand Turkey US Ukraine United Kingdom
Date
2020-01-22 0 0 0 0 0 0 0 0 0 17 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
2020-01-23 0 0 0 0 0 0 0 0 0 18 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
2020-01-24 0 0 0 0 0 0 0 0 0 26 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
2020-01-25 0 0 0 0 0 0 0 0 0 42 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
2020-01-26 0 0 0 0 0 0 0 0 0 56 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ...
2020-04-03 105 39 28 168 1143 17 359 179 22 3326 25 53 139 68 145 66 20 6520 1275 63 26 72 181 3294 54 120 40 14681 63 174 31 53 50 48 1490 12 59 40 37 61 136 71 246 133 34 30 25 39 20 11198 358 591 19 425 7087 27 3611
2020-04-04 130 43 30 186 1283 21 445 218 27 3330 32 59 161 68 172 71 25 7574 1444 68 32 86 191 3452 56 137 44 15362 77 177 31 57 60 59 1656 17 62 41 41 73 144 79 266 146 43 32 29 44 22 11947 373 666 20 501 8407 32 4320
2020-04-05 152 44 35 204 1447 23 486 259 34 3333 35 67 179 82 180 78 28 8093 1584 73 34 99 198 3603 61 158 49 15887 77 183 36 61 79 70 1771 18 71 47 46 83 152 94 295 151 45 32 34 51 28 12641 401 715 23 574 9619 37 4943
2020-04-06 173 48 40 220 1632 29 564 339 37 3335 46 78 187 86 191 85 27 8926 1810 79 38 136 209 3739 64 174 57 16523 85 186 41 62 94 80 1874 23 76 53 54 92 163 107 311 176 47 32 38 58 30 13341 477 765 26 649 10783 38 5385
2020-04-07 193 56 45 243 2035 33 686 375 43 3335 50 88 203 98 191 94 34 10343 2016 81 47 150 221 3872 65 210 65 17127 92 192 44 63 125 90 2108 26 89 57 55 107 177 129 345 197 58 34 41 61 36 14045 591 821 27 725 12722 45 6171

77 rows × 57 columns

In [34]:
print("Kasus Kematian terkecil namun paling tinggi:", death.min().max())
print("Kasus Kematian maximum namun paling besar nilainya: ",death.max().max())
print("Kasus Kematian maximum namun paling kecil nilainya: ",death.max().min())
Kasus Kematian terkecil namun paling tinggi: 17
Kasus Kematian maximum namun paling besar nilainya:  17127
Kasus Kematian maximum namun paling kecil nilainya:  26

Berdasarkan tabel diatas dari 184 negara, hanya 57 negara saja yang memiliki jumlah kematian lebih dari sama dengan 25 pada periode akhir (7 April 2020). Dari ke-57 negara tersebut yang kasus kematian pertama paling tinggi bernilai 17 yakni berasal dari negara China (tanggal 22 Januari 2020). Sedangkan pada akhir periode, kasus kematian terbanyak ialah berasal dari negara Italia dengan total akhir kasus kematian mencapai 17.127. Selanjutnya negara dengan kasus terkecil pada periode akhir berasal dari negara North Macedonia dengan total kasus kematian hanya mencapai 26 di akhir periode.

In [35]:
#untuk mnegetahui masing-masing tanggal dimulai dan berakhir tiap negara
algeria = death['Algeria']
Algeria = pd.DataFrame(algeria)
Algeria = Algeria[Algeria['Algeria']>=25] 
Algeria
Out[35]:
Algeria
Date
2020-03-26 25
2020-03-27 26
2020-03-28 29
2020-03-29 31
2020-03-30 35
2020-03-31 44
2020-04-01 58
2020-04-02 86
2020-04-03 105
2020-04-04 130
2020-04-05 152
2020-04-06 173
2020-04-07 193

Visualisasikan hasil diatas dan berikan/atur judul, labels, dan spesifikasi (ukuran, warna, ketebalan, dll) yang sesuai sehingga plot/kurva yang dihasilkan rapi, menarik, dan mudah dipahami.

In [36]:
plt.style.use('https://github.com/dhaitz/matplotlib-stylesheets/raw/master/pitayasmoothie-light.mplstyle')
Algeria = pd.merge(confirmed_country["Algeria"], death["Algeria"], left_index=True, right_index=True)
Algeria.rename(columns = {'Algeria_x':'Confirmed Cases'}, inplace = True)
Algeria.rename(columns = {'Algeria_y':'Death Cases'}, inplace = True)
Algeria["2020-03-26":"2020-04-07"].plot(linewidth=3)
plt.title('Kasus Kematian COVID-19 di Algeria')
plt.xlabel('Tanggal')
plt.ylabel('Jumlah Kasus Kematian')
plt.gcf().set_size_inches(8, 7)

Argentina = pd.merge(confirmed_country["Argentina"], death["Argentina"], left_index=True, right_index=True)
Argentina.rename(columns = {'Argentina_x':'Confirmed Cases'}, inplace = True)
Argentina.rename(columns = {'Argentina_y':'Death Cases'}, inplace = True)
Argentina["2020-03-31":"2020-04-07"].plot(linewidth=3)
plt.title('Kasus Kematian COVID-19 di Argentina')
plt.xlabel('Tanggal')
plt.ylabel('Jumlah Kasus Kematian')
plt.style.use('https://github.com/dhaitz/matplotlib-stylesheets/raw/master/pitayasmoothie-light.mplstyle')
plt.gcf().set_size_inches(8, 7)

Australia = pd.merge(confirmed_country["Australia"], death["Australia"], left_index=True, right_index=True)
Australia.rename(columns = {'Australia_x':'Confirmed Cases'}, inplace = True)
Australia.rename(columns = {'Australia_y':'Death Cases'}, inplace = True)
Australia["2020-04-03":"2020-04-07"].plot(linewidth=3)
plt.title('Kasus Kematian COVID-19 di Australia')
plt.xlabel('Tanggal')
plt.ylabel('Jumlah Kasus Kematian')
plt.style.use('https://github.com/dhaitz/matplotlib-stylesheets/raw/master/pitayasmoothie-light.mplstyle')
plt.gcf().set_size_inches(8, 7)

Austria = pd.merge(confirmed_country["Austria"], death["Austria"], left_index=True, right_index=True)
Austria.rename(columns = {'Austria_x':'Confirmed Cases'}, inplace = True)
Austria.rename(columns = {'Austria_y':'Death Cases'}, inplace = True)
Austria["2020-03-24":"2020-04-07"].plot(linewidth=3)
plt.title('Kasus Kematian COVID-19 di Austria')
plt.xlabel('Tanggal')
plt.ylabel('Jumlah Kasus Kematian')
plt.style.use('https://github.com/dhaitz/matplotlib-stylesheets/raw/master/pitayasmoothie-light.mplstyle')
plt.gcf().set_size_inches(8, 7)

Belgium = pd.merge(confirmed_country["Belgium"], death["Belgium"], left_index=True, right_index=True)
Belgium.rename(columns = {'Belgium_x':'Confirmed Cases'}, inplace = True)
Belgium.rename(columns = {'Belgium_y':'Death Cases'}, inplace = True)
Belgium["2020-03-20":"2020-04-07"].plot(linewidth=3)
plt.title('Kasus Kematian COVID-19 di Belgium')
plt.xlabel('Tanggal')
plt.ylabel('Jumlah Kasus Kematian')
plt.style.use('https://github.com/dhaitz/matplotlib-stylesheets/raw/master/pitayasmoothie-light.mplstyle')
plt.gcf().set_size_inches(8, 7)

bosniaandherzegovina = pd.merge(confirmed_country["Bosnia and Herzegovina"], death["Bosnia and Herzegovina"], left_index=True, right_index=True)
bosniaandherzegovina.rename(columns = {'Bosnia and Herzegovina_x':'Confirmed Cases'}, inplace = True)
bosniaandherzegovina.rename(columns = {'Bosnia and Herzegovina_y':'Death Cases'}, inplace = True)
bosniaandherzegovina["2020-04-06":"2020-04-07"].plot(linewidth=3)
plt.title('Kasus Kematian COVID-19 di Bosnia and Herzegovina')
plt.xlabel('Tanggal')
plt.ylabel('Jumlah Kasus Kematian')
plt.style.use('https://github.com/dhaitz/matplotlib-stylesheets/raw/master/pitayasmoothie-light.mplstyle')
plt.gcf().set_size_inches(8, 7)

Brazil = pd.merge(confirmed_country["Brazil"], death["Brazil"], left_index=True, right_index=True)
Brazil.rename(columns = {'Brazil_x':'Confirmed Cases'}, inplace = True)
Brazil.rename(columns = {'Brazil_y':'Death Cases'}, inplace = True)
Brazil["2020-03-22":"2020-04-07"].plot(linewidth=3)
plt.title('Kasus Kematian COVID-19 di Brazil')
plt.xlabel('Tanggal')
plt.ylabel('Jumlah Kasus Kematian')
plt.style.use('https://github.com/dhaitz/matplotlib-stylesheets/raw/master/pitayasmoothie-light.mplstyle')
plt.gcf().set_size_inches(8, 7)

Canada = pd.merge(confirmed_country["Canada"], death["Canada"], left_index=True, right_index=True)
Canada.rename(columns = {'Canada_x':'Confirmed Cases'}, inplace = True)
Canada.rename(columns = {'Canada_y':'Death Cases'}, inplace = True)
Canada["2020-03-23":"2020-04-07"].plot(linewidth=3)
plt.title('Kasus Kematian COVID-19 di Canada')
plt.xlabel('Tanggal')
plt.ylabel('Jumlah Kasus Kematian')
plt.style.use('https://github.com/dhaitz/matplotlib-stylesheets/raw/master/pitayasmoothie-light.mplstyle')
plt.gcf().set_size_inches(8, 7)


Chile = pd.merge(confirmed_country["Chile"], death["Chile"], left_index=True, right_index=True)
Chile.rename(columns = {'Chile_x':'Confirmed Cases'}, inplace = True)
Chile.rename(columns = {'Chile_y':'Death Cases'}, inplace = True)
Chile["2020-04-04":"2020-04-07"].plot(linewidth=3)
plt.title('Kasus Kematian COVID-19 di Chile')
plt.xlabel('Tanggal')
plt.ylabel('Jumlah Kasus Kematian')
plt.style.use('https://github.com/dhaitz/matplotlib-stylesheets/raw/master/pitayasmoothie-light.mplstyle')
plt.gcf().set_size_inches(8, 7)

China = pd.merge(confirmed_country["China"], death["China"], left_index=True, right_index=True)
China.rename(columns = {'China_x':'Confirmed Cases'}, inplace = True)
China.rename(columns = {'China_y':'Death Cases'}, inplace = True)
China["2020-01-24":"2020-04-07"].plot(linewidth=3)
plt.title('Kasus Kematian COVID-19 di China')
plt.xlabel('Tanggal')
plt.ylabel('Jumlah Kasus Kematian')
plt.style.use('https://github.com/dhaitz/matplotlib-stylesheets/raw/master/pitayasmoothie-light.mplstyle')
plt.gcf().set_size_inches(8, 7)

Colombia = pd.merge(confirmed_country["Colombia"], death["Colombia"], left_index=True, right_index=True)
Colombia.rename(columns = {'Colombia_x':'Confirmed Cases'}, inplace = True)
Colombia.rename(columns = {'Colombia_y':'Death Cases'}, inplace = True)
Colombia["2020-04-03":"2020-04-07"].plot(linewidth=3)
plt.title('Kasus Kematian COVID-19 di Colombia')
plt.xlabel('Tanggal')
plt.ylabel('Jumlah Kasus Kematian')
plt.style.use('https://github.com/dhaitz/matplotlib-stylesheets/raw/master/pitayasmoothie-light.mplstyle')
plt.gcf().set_size_inches(8, 7)

Czechia = pd.merge(confirmed_country["Czechia"], death["Czechia"], left_index=True, right_index=True)
Czechia.rename(columns = {'Czechia_x':'Confirmed Cases'}, inplace = True)
Czechia.rename(columns = {'Czechia_y':'Death Cases'}, inplace = True)
Czechia["2020-03-31":"2020-04-07"].plot(linewidth=3)
plt.title('Kasus Kematian COVID-19 di Czechia')
plt.xlabel('Tanggal')
plt.ylabel('Jumlah Kasus Kematian')
plt.style.use('https://github.com/dhaitz/matplotlib-stylesheets/raw/master/pitayasmoothie-light.mplstyle')
plt.gcf().set_size_inches(8, 7)

Denmark = pd.merge(confirmed_country["Denmark"], death["Denmark"], left_index=True, right_index=True)
Denmark.rename(columns = {'Denmark_x':'Confirmed Cases'}, inplace = True)
Denmark.rename(columns = {'Denmark_y':'Death Cases'}, inplace = True)
Denmark["2020-03-24":"2020-04-07"].plot(linewidth=3)
plt.title('Kasus Kematian COVID-19 di Denmark')
plt.xlabel('Tanggal')
plt.ylabel('Jumlah Kasus Kematian')
plt.style.use('https://github.com/dhaitz/matplotlib-stylesheets/raw/master/pitayasmoothie-light.mplstyle')
plt.gcf().set_size_inches(8, 7)

dominicanrepublic = pd.merge(confirmed_country["Dominican Republic"], death["Dominican Republic"], left_index=True, right_index=True)
dominicanrepublic.rename(columns = {'Dominican Republic_x':'Confirmed Cases'}, inplace = True)
dominicanrepublic.rename(columns = {'Dominican Republic_y':'Death Cases'}, inplace = True)
dominicanrepublic["2020-03-28":"2020-04-07"].plot(linewidth=3)
plt.title('Kasus Kematian COVID-19 di Dominican Republic')
plt.xlabel('Tanggal')
plt.ylabel('Jumlah Kasus Kematian')
plt.style.use('https://github.com/dhaitz/matplotlib-stylesheets/raw/master/pitayasmoothie-light.mplstyle')
plt.gcf().set_size_inches(8, 7)

Ecuador = pd.merge(confirmed_country["Ecuador"], death["Ecuador"], left_index=True, right_index=True)
Ecuador.rename(columns = {'Ecuador_x':'Confirmed Cases'}, inplace = True)
Ecuador.rename(columns = {'Ecuador_y':'Death Cases'}, inplace = True)
Ecuador["2020-03-24":"2020-04-07"].plot(linewidth=3)
plt.title('Kasus Kematian COVID-19 di Ecuador')
plt.xlabel('Tanggal')
plt.ylabel('Jumlah Kasus Kematian')
plt.style.use('https://github.com/dhaitz/matplotlib-stylesheets/raw/master/pitayasmoothie-light.mplstyle')
plt.gcf().set_size_inches(8, 7)

Egypt = pd.merge(confirmed_country["Egypt"], death["Egypt"], left_index=True, right_index=True)
Egypt.rename(columns = {'Egypt_x':'Confirmed Cases'}, inplace = True)
Egypt.rename(columns = {'Egypt_y':'Death Cases'}, inplace = True)
Egypt["2020-03-27":"2020-04-07"].plot(linewidth=3)
plt.title('Kasus Kematian COVID-19 di Egypt')
plt.xlabel('Tanggal')
plt.ylabel('Jumlah Kasus Kematian')
plt.style.use('https://github.com/dhaitz/matplotlib-stylesheets/raw/master/pitayasmoothie-light.mplstyle')
plt.gcf().set_size_inches(8, 7)

Finland = pd.merge(confirmed_country["Finland"], death["Finland"], left_index=True, right_index=True)
Finland.rename(columns = {'Finland_x':'Confirmed Cases'}, inplace = True)
Finland.rename(columns = {'Finland_y':'Death Cases'}, inplace = True)
Finland["2020-04-04":"2020-04-07"].plot(linewidth=3)
plt.title('Kasus Kematian COVID-19 di Finland')
plt.xlabel('Tanggal')
plt.ylabel('Jumlah Kasus Kematian')
plt.style.use('https://github.com/dhaitz/matplotlib-stylesheets/raw/master/pitayasmoothie-light.mplstyle')
plt.gcf().set_size_inches(8, 7)

France = pd.merge(confirmed_country["France"], death["France"], left_index=True, right_index=True)
France.rename(columns = {'France_x':'Confirmed Cases'}, inplace = True)
France.rename(columns = {'France_y':'Death Cases'}, inplace = True)
France["2020-03-10":"2020-04-07"].plot(linewidth=3)
plt.title('Kasus Kematian COVID-19 di France')
plt.xlabel('Tanggal')
plt.ylabel('Jumlah Kasus Kematian')
plt.style.use('https://github.com/dhaitz/matplotlib-stylesheets/raw/master/pitayasmoothie-light.mplstyle')
plt.gcf().set_size_inches(8, 7)

Germany = pd.merge(confirmed_country["Germany"], death["Germany"], left_index=True, right_index=True)
Germany.rename(columns = {'Germany_x':'Confirmed Cases'}, inplace = True)
Germany.rename(columns = {'Germany_y':'Death Cases'}, inplace = True)
Germany["2020-03-18":"2020-04-07"].plot(linewidth=3)
plt.title('Kasus Kematian COVID-19 di Germany')
plt.xlabel('Tanggal')
plt.ylabel('Jumlah Kasus Kematian')
plt.style.use('https://github.com/dhaitz/matplotlib-stylesheets/raw/master/pitayasmoothie-light.mplstyle')
plt.gcf().set_size_inches(8, 7)

Greece = pd.merge(confirmed_country["Greece"], death["Greece"], left_index=True, right_index=True)
Greece.rename(columns = {'Greece_x':'Confirmed Cases'}, inplace = True)
Greece.rename(columns = {'Greece_y':'Death Cases'}, inplace = True)
Greece["2020-03-26":"2020-04-07"].plot(linewidth=3)
plt.title('Kasus Kematian COVID-19 di Greece')
plt.xlabel('Tanggal')
plt.ylabel('Jumlah Kasus Kematian')
plt.style.use('https://github.com/dhaitz/matplotlib-stylesheets/raw/master/pitayasmoothie-light.mplstyle')
plt.gcf().set_size_inches(8, 7)

Hungary = pd.merge(confirmed_country["Hungary"], death["Hungary"], left_index=True, right_index=True)
Hungary.rename(columns = {'Hungary_x':'Confirmed Cases'}, inplace = True)
Hungary.rename(columns = {'Hungary_y':'Death Cases'}, inplace = True)
Hungary["2020-04-03":"2020-04-07"].plot(linewidth=3)
plt.title('Kasus Kematian COVID-19 di Hungary')
plt.xlabel('Tanggal')
plt.ylabel('Jumlah Kasus Kematian')
plt.style.use('https://github.com/dhaitz/matplotlib-stylesheets/raw/master/pitayasmoothie-light.mplstyle')
plt.gcf().set_size_inches(8, 7)

India = pd.merge(confirmed_country["India"], death["India"], left_index=True, right_index=True)
India.rename(columns = {'India_x':'Confirmed Cases'}, inplace = True)
India.rename(columns = {'India_y':'Death Cases'}, inplace = True)
India["2020-03-29":"2020-04-07"].plot(linewidth=3)
plt.title('Kasus Kematian COVID-19 di India')
plt.xlabel('Tanggal')
plt.ylabel('Jumlah Kasus Kematian')
plt.style.use('https://github.com/dhaitz/matplotlib-stylesheets/raw/master/pitayasmoothie-light.mplstyle')
plt.gcf().set_size_inches(8, 7)

Indonesia = pd.merge(confirmed_country["Indonesia"], death["Indonesia"], left_index=True, right_index=True)
Indonesia.rename(columns = {'Indonesia_x':'Confirmed Cases'}, inplace = True)
Indonesia.rename(columns = {'Indonesia_y':'Death Cases'}, inplace = True)
Indonesia["2020-03-19":"2020-04-07"].plot(linewidth=3)
plt.title('Kasus Kematian COVID-19 di Indonesia')
plt.xlabel('Tanggal')
plt.ylabel('Jumlah Kasus Kematian')
plt.style.use('https://github.com/dhaitz/matplotlib-stylesheets/raw/master/pitayasmoothie-light.mplstyle')
plt.gcf().set_size_inches(8, 7)

Iran = pd.merge(confirmed_country["Iran"], death["Iran"], left_index=True, right_index=True)
Iran.rename(columns = {'Iran_x':'Confirmed Cases'}, inplace = True)
Iran.rename(columns = {'Iran_y':'Death Cases'}, inplace = True)
Iran["2020-02-27":"2020-04-07"].plot(linewidth=3)
plt.title('Kasus Kematian COVID-19 di Iran')
plt.xlabel('Tanggal')
plt.ylabel('Jumlah Kasus Kematian')
plt.style.use('https://github.com/dhaitz/matplotlib-stylesheets/raw/master/pitayasmoothie-light.mplstyle')
plt.gcf().set_size_inches(8, 7)

Iraq = pd.merge(confirmed_country["Iraq"], death["Iraq"], left_index=True, right_index=True)
Iraq.rename(columns = {'Iraq_x':'Confirmed Cases'}, inplace = True)
Iraq.rename(columns = {'Iraq_y':'Death Cases'}, inplace = True)
Iraq["2020-03-24":"2020-04-07"].plot(linewidth=3)
plt.title('Kasus Kematian COVID-19 di Iraq')
plt.xlabel('Tanggal')
plt.ylabel('Jumlah Kasus Kematian')
plt.style.use('https://github.com/dhaitz/matplotlib-stylesheets/raw/master/pitayasmoothie-light.mplstyle')
plt.gcf().set_size_inches(8, 7)

Ireland = pd.merge(confirmed_country["Ireland"], death["Ireland"], left_index=True, right_index=True)
Ireland.rename(columns = {'Ireland_x':'Confirmed Cases'}, inplace = True)
Ireland.rename(columns = {'Ireland_y':'Death Cases'}, inplace = True)
Ireland["2020-03-28":"2020-04-07"].plot(linewidth=3)
plt.title('Kasus Kematian COVID-19 di Ireland')
plt.xlabel('Tanggal')
plt.ylabel('Jumlah Kasus Kematian')
plt.style.use('https://github.com/dhaitz/matplotlib-stylesheets/raw/master/pitayasmoothie-light.mplstyle')
plt.gcf().set_size_inches(8, 7)

Israel = pd.merge(confirmed_country["Israel"], death["Israel"], left_index=True, right_index=True)
Israel.rename(columns = {'Israel_x':'Confirmed Cases'}, inplace = True)
Israel.rename(columns = {'Israel_y':'Death Cases'}, inplace = True)
Israel["2020-04-01":"2020-04-07"].plot(linewidth=3)
plt.title('Kasus Kematian COVID-19 di Israel')
plt.xlabel('Tanggal')
plt.ylabel('Jumlah Kasus Kematian')
plt.style.use('https://github.com/dhaitz/matplotlib-stylesheets/raw/master/pitayasmoothie-light.mplstyle')
plt.gcf().set_size_inches(8, 7)

Italy = pd.merge(confirmed_country["Italy"], death["Italy"], left_index=True, right_index=True)
Italy.rename(columns = {'Italy_x':'Confirmed Cases'}, inplace = True)
Italy.rename(columns = {'Italy_y':'Death Cases'}, inplace = True)
Italy["2020-02-29":"2020-04-07"].plot(linewidth=3)
plt.title('Kasus Kematian COVID-19 di Italy')
plt.xlabel('Tanggal')
plt.ylabel('Jumlah Kasus Kematian')
plt.style.use('https://github.com/dhaitz/matplotlib-stylesheets/raw/master/pitayasmoothie-light.mplstyle')
plt.gcf().set_size_inches(8, 7)

Japan = pd.merge(confirmed_country["Japan"], death["Japan"], left_index=True, right_index=True)
Japan.rename(columns = {'Japan_x':'Confirmed Cases'}, inplace = True)
Japan.rename(columns = {'Japan_y':'Death Cases'}, inplace = True)
Japan["2020-03-16":"2020-04-07"].plot(linewidth=3)
plt.title('Kasus Kematian COVID-19 di Japan')
plt.xlabel('Tanggal')
plt.ylabel('Jumlah Kasus Kematian')
plt.style.use('https://github.com/dhaitz/matplotlib-stylesheets/raw/master/pitayasmoothie-light.mplstyle')
plt.gcf().set_size_inches(8, 7)

KoreaSouth = pd.merge(confirmed_country["Korea, South"], death["Korea, South"], left_index=True, right_index=True)
KoreaSouth.rename(columns = {'Korea, South_x':'Confirmed Cases'}, inplace = True)
KoreaSouth.rename(columns = {'Korea, South_y':'Death Cases'}, inplace = True)
KoreaSouth["2020-03-02":"2020-04-07"].plot(linewidth=3)
plt.title('Kasus Kematian COVID-19 di Korea, South')
plt.xlabel('Tanggal')
plt.ylabel('Jumlah Kasus Kematian')
plt.style.use('https://github.com/dhaitz/matplotlib-stylesheets/raw/master/pitayasmoothie-light.mplstyle')
plt.gcf().set_size_inches(8, 7)

Luxembourg = pd.merge(confirmed_country["Luxembourg"], death["Luxembourg"], left_index=True, right_index=True)
Luxembourg.rename(columns = {'Luxembourg_x':'Confirmed Cases'}, inplace = True)
Luxembourg.rename(columns = {'Luxembourg_y':'Death Cases'}, inplace = True)
Luxembourg["2020-04-01":"2020-04-07"].plot(linewidth=3)
plt.title('Kasus Kematian COVID-19 di Luxembourg')
plt.xlabel('Tanggal')
plt.ylabel('Jumlah Kasus Kematian')
plt.style.use('https://github.com/dhaitz/matplotlib-stylesheets/raw/master/pitayasmoothie-light.mplstyle')
plt.gcf().set_size_inches(8, 7)

Malaysia = pd.merge(confirmed_country["Malaysia"], death["Malaysia"], left_index=True, right_index=True)
Malaysia.rename(columns = {'Malaysia_x':'Confirmed Cases'}, inplace = True)
Malaysia.rename(columns = {'Malaysia_y':'Death Cases'}, inplace = True)
Malaysia["2020-03-27":"2020-04-07"].plot(linewidth=3)
plt.title('Kasus Kematian COVID-19 di Malaysia')
plt.xlabel('Tanggal')
plt.ylabel('Jumlah Kasus Kematian')
plt.style.use('https://github.com/dhaitz/matplotlib-stylesheets/raw/master/pitayasmoothie-light.mplstyle')
plt.gcf().set_size_inches(8, 7)

Mexico = pd.merge(confirmed_country["Mexico"], death["Mexico"], left_index=True, right_index=True)
Mexico.rename(columns = {'Mexico_x':'Confirmed Cases'}, inplace = True)
Mexico.rename(columns = {'Mexico_y':'Death Cases'}, inplace = True)
Mexico["2020-03-31":"2020-04-07"].plot(linewidth=3)
plt.title('Kasus Kematian COVID-19 di Mexico')
plt.xlabel('Tanggal')
plt.ylabel('Jumlah Kasus Kematian')
plt.style.use('https://github.com/dhaitz/matplotlib-stylesheets/raw/master/pitayasmoothie-light.mplstyle')
plt.gcf().set_size_inches(8, 7)

Morocco = pd.merge(confirmed_country["Morocco"], death["Morocco"], left_index=True, right_index=True)
Morocco.rename(columns = {'Morocco_x':'Confirmed Cases'}, inplace = True)
Morocco.rename(columns = {'Morocco_y':'Death Cases'}, inplace = True)
Morocco["2020-03-28":"2020-04-07"].plot(linewidth=3)
plt.title('Kasus Kematian COVID-19 di Morocco')
plt.xlabel('Tanggal')
plt.ylabel('Jumlah Kasus Kematian')
plt.style.use('https://github.com/dhaitz/matplotlib-stylesheets/raw/master/pitayasmoothie-light.mplstyle')
plt.gcf().set_size_inches(8, 7)
       
Netherlands = pd.merge(confirmed_country["Netherlands"], death["Netherlands"], left_index=True, right_index=True)
Netherlands.rename(columns = {'Netherlands_x':'Confirmed Cases'}, inplace = True)
Netherlands.rename(columns = {'Netherlands_y':'Death Cases'}, inplace = True)
Netherlands["2020-03-17":"2020-04-07"].plot(linewidth=3)
plt.title('Kasus Kematian COVID-19 di Netherlands')
plt.xlabel('Tanggal')
plt.ylabel('Jumlah Kasus Kematian')
plt.style.use('https://github.com/dhaitz/matplotlib-stylesheets/raw/master/pitayasmoothie-light.mplstyle')
plt.gcf().set_size_inches(8, 7)

NorthMacedonia = pd.merge(confirmed_country["North Macedonia"], death["North Macedonia"], left_index=True, right_index=True)
NorthMacedonia.rename(columns = {'North Macedonia_x':'Confirmed Cases'}, inplace = True)
NorthMacedonia.rename(columns = {'North Macedonia_y':'Death Cases'}, inplace = True)
NorthMacedonia["2020-04-07":"2020-04-07"].plot(linewidth=3)
plt.title('Kasus Kematian COVID-19 di North Macedonia')
plt.xlabel('Tanggal')
plt.ylabel('Jumlah Kasus Kematian')
plt.style.use('https://github.com/dhaitz/matplotlib-stylesheets/raw/master/pitayasmoothie-light.mplstyle')
plt.gcf().set_size_inches(8, 7)

Norway = pd.merge(confirmed_country["Norway"], death["Norway"], left_index=True, right_index=True)
Norway.rename(columns = {'Norway_x':'Confirmed Cases'}, inplace = True)
Norway.rename(columns = {'Norway_y':'Death Cases'}, inplace = True)
Norway["2020-03-29":"2020-04-07"].plot(linewidth=3)
plt.title('Kasus Kematian COVID-19 di Norway')
plt.xlabel('Tanggal')
plt.ylabel('Jumlah Kasus Kematian')
plt.style.use('https://github.com/dhaitz/matplotlib-stylesheets/raw/master/pitayasmoothie-light.mplstyle')
plt.gcf().set_size_inches(8, 7)

Pakistan = pd.merge(confirmed_country["Pakistan"], death["Pakistan"], left_index=True, right_index=True)
Pakistan.rename(columns = {'Pakistan_x':'Confirmed Cases'}, inplace = True)
Pakistan.rename(columns = {'Pakistan_y':'Death Cases'}, inplace = True)
Pakistan["2020-03-31":"2020-04-07"].plot(linewidth=3)
plt.title('Kasus Kematian COVID-19 di Pakistan')
plt.xlabel('Tanggal')
plt.ylabel('Jumlah Kasus Kematian')
plt.style.use('https://github.com/dhaitz/matplotlib-stylesheets/raw/master/pitayasmoothie-light.mplstyle')
plt.gcf().set_size_inches(8, 7)

Panama = pd.merge(confirmed_country["Panama"], death["Panama"], left_index=True, right_index=True)
Panama.rename(columns = {'Panama_x':'Confirmed Cases'}, inplace = True)
Panama.rename(columns = {'Panama_y':'Death Cases'}, inplace = True)
Panama["2020-03-31":"2020-04-07"].plot(linewidth=3)
plt.title('Kasus Kematian COVID-19 di Panama')
plt.xlabel('Tanggal')
plt.ylabel('Jumlah Kasus Kematian')
plt.style.use('https://github.com/dhaitz/matplotlib-stylesheets/raw/master/pitayasmoothie-light.mplstyle')
plt.gcf().set_size_inches(8, 7)

Peru = pd.merge(confirmed_country["Peru"], death["Peru"], left_index=True, right_index=True)
Peru.rename(columns = {'Peru_x':'Confirmed Cases'}, inplace = True)
Peru.rename(columns = {'Peru_y':'Death Cases'}, inplace = True)
Peru["2020-03-31":"2020-04-07"].plot(linewidth=3)
plt.title('Kasus Kematian COVID-19 di Peru')
plt.xlabel('Tanggal')
plt.ylabel('Jumlah Kasus Kematian')
plt.style.use('https://github.com/dhaitz/matplotlib-stylesheets/raw/master/pitayasmoothie-light.mplstyle')
plt.gcf().set_size_inches(8, 7)

Philippines = pd.merge(confirmed_country["Philippines"], death["Philippines"], left_index=True, right_index=True)
Philippines.rename(columns = {'Philippines_x':'Confirmed Cases'}, inplace = True)
Philippines.rename(columns = {'Philippines_y':'Death Cases'}, inplace = True)
Philippines["2020-03-22":"2020-04-07"].plot(linewidth=3)
plt.title('Kasus Kematian COVID-19 di Philippines')
plt.xlabel('Tanggal')
plt.ylabel('Jumlah Kasus Kematian')
plt.style.use('https://github.com/dhaitz/matplotlib-stylesheets/raw/master/pitayasmoothie-light.mplstyle')
plt.gcf().set_size_inches(8, 7)

Poland = pd.merge(confirmed_country["Poland"], death["Poland"], left_index=True, right_index=True)
Poland.rename(columns = {'Poland_x':'Confirmed Cases'}, inplace = True)
Poland.rename(columns = {'Poland_y':'Death Cases'}, inplace = True)
Poland["2020-03-30":"2020-04-07"].plot(linewidth=3)
plt.title('Kasus Kematian COVID-19 di Poland')
plt.xlabel('Tanggal')
plt.ylabel('Jumlah Kasus Kematian')
plt.style.use('https://github.com/dhaitz/matplotlib-stylesheets/raw/master/pitayasmoothie-light.mplstyle')
plt.gcf().set_size_inches(8, 7)

Portugal = pd.merge(confirmed_country["Portugal"], death["Portugal"], left_index=True, right_index=True)
Portugal.rename(columns = {'Portugal_x':'Confirmed Cases'}, inplace = True)
Portugal.rename(columns = {'Portugal_y':'Death Cases'}, inplace = True)
Portugal["2020-03-24":"2020-04-07"].plot(linewidth=3)
plt.title('Kasus Kematian COVID-19 di Portugal')
plt.xlabel('Tanggal')
plt.ylabel('Jumlah Kasus Kematian')
plt.style.use('https://github.com/dhaitz/matplotlib-stylesheets/raw/master/pitayasmoothie-light.mplstyle')
plt.gcf().set_size_inches(8, 7)

Romania = pd.merge(confirmed_country["Romania"], death["Romania"], left_index=True, right_index=True)
Romania.rename(columns = {'Romania_x':'Confirmed Cases'}, inplace = True)
Romania.rename(columns = {'Romania_y':'Death Cases'}, inplace = True)
Romania["2020-03-27":"2020-04-07"].plot(linewidth=3)
plt.title('Kasus Kematian COVID-19 di Romania')
plt.xlabel('Tanggal')
plt.ylabel('Jumlah Kasus Kematian')
plt.style.use('https://github.com/dhaitz/matplotlib-stylesheets/raw/master/pitayasmoothie-light.mplstyle')
plt.gcf().set_size_inches(8, 7)

Russia = pd.merge(confirmed_country["Russia"], deaths["Russia"], left_index=True, right_index=True)
Russia.rename(columns = {'Russia_x':'Confirmed Cases'}, inplace = True)
Russia.rename(columns = {'Russia_y':'Death Cases'}, inplace = True)
Russia["2020-04-02":"2020-04-07"].plot(linewidth=3)
plt.title('Kasus Kematian COVID-19 di Russia')
plt.xlabel('Tanggal')
plt.ylabel('Jumlah Kasus Kematian')
plt.style.use('https://github.com/dhaitz/matplotlib-stylesheets/raw/master/pitayasmoothie-light.mplstyle')
plt.gcf().set_size_inches(8, 7)


SanMarino = pd.merge(confirmed_country["San Marino"], death["San Marino"], left_index=True, right_index=True)
SanMarino.rename(columns = {'San Marino_x':'Confirmed Cases'}, inplace = True)
SanMarino.rename(columns = {'San Marino_y':'Death Cases'}, inplace = True)
SanMarino["2020-03-30":"2020-04-07"].plot(linewidth=3)
plt.title('Kasus Kematian COVID-19 di San Marino')
plt.xlabel('Tanggal')
plt.ylabel('Jumlah Kasus Kematian')
plt.style.use('https://github.com/dhaitz/matplotlib-stylesheets/raw/master/pitayasmoothie-light.mplstyle')
plt.gcf().set_size_inches(8, 7)

SaudiArabia = pd.merge(confirmed_country["Saudi Arabia"], death["Saudi Arabia"], left_index=True, right_index=True)
SaudiArabia.rename(columns = {'Saudi Arabia_x':'Confirmed Cases'}, inplace = True)
SaudiArabia.rename(columns = {'Saudi Arabia_y':'Death Cases'}, inplace = True)
SaudiArabia["2020-04-03":"2020-04-07"].plot(linewidth=3)
plt.title('Kasus Kematian COVID-19 di Saudi Arabia')
plt.xlabel('Tanggal')
plt.ylabel('Jumlah Kasus Kematian')
plt.style.use('https://github.com/dhaitz/matplotlib-stylesheets/raw/master/pitayasmoothie-light.mplstyle')
plt.gcf().set_size_inches(8, 7)

Serbia = pd.merge(confirmed_country["Serbia"], death["Serbia"], left_index=True, right_index=True)
Serbia.rename(columns = {'Serbia_x':'Confirmed Cases'}, inplace = True)
Serbia.rename(columns = {'Serbia_y':'Death Cases'}, inplace = True)
Serbia["2020-04-01":"2020-04-07"].plot(linewidth=3)
plt.title('Kasus Kematian COVID-19 di Serbia')
plt.xlabel('Tanggal')
plt.ylabel('Jumlah Kasus Kematian')
plt.style.use('https://github.com/dhaitz/matplotlib-stylesheets/raw/master/pitayasmoothie-light.mplstyle')
plt.gcf().set_size_inches(8, 7)

Slovenia = pd.merge(confirmed_country["Slovenia"], death["Slovenia"], left_index=True, right_index=True)
Slovenia.rename(columns = {'Slovenia_x':'Confirmed Cases'}, inplace = True)
Slovenia.rename(columns = {'Slovenia_y':'Death Cases'}, inplace = True)
Slovenia["2020-04-05":"2020-04-07"].plot(linewidth=3)
plt.title('Kasus Kematian COVID-19 di Slovenia')
plt.xlabel('Tanggal')
plt.ylabel('Jumlah Kasus Kematian')
plt.style.use('https://github.com/dhaitz/matplotlib-stylesheets/raw/master/pitayasmoothie-light.mplstyle')
plt.gcf().set_size_inches(8, 7)

Spain = pd.merge(confirmed_country["Spain"], death["Spain"], left_index=True, right_index=True)
Spain.rename(columns = {'Spain_x':'Confirmed Cases'}, inplace = True)
Spain.rename(columns = {'Spain_y':'Death Cases'}, inplace = True)
Spain["2020-03-09":"2020-04-07"].plot(linewidth=3)
plt.title('Kasus Kematian COVID-19 di Spain')
plt.xlabel('Tanggal')
plt.ylabel('Jumlah Kasus Kematian')
plt.style.use('https://github.com/dhaitz/matplotlib-stylesheets/raw/master/pitayasmoothie-light.mplstyle')
plt.gcf().set_size_inches(8, 7)

Sweden = pd.merge(confirmed_country["Sweden"], death["Sweden"], left_index=True, right_index=True)
Sweden.rename(columns = {'Sweden_x':'Confirmed Cases'}, inplace = True)
Sweden.rename(columns = {'Sweden_y':'Death Cases'}, inplace = True)
Sweden["2020-03-23":"2020-04-07"].plot(linewidth=3)
plt.title('Kasus Kematian COVID-19 di Sweden')
plt.xlabel('Tanggal')
plt.ylabel('Jumlah Kasus Kematian')
plt.style.use('https://github.com/dhaitz/matplotlib-stylesheets/raw/master/pitayasmoothie-light.mplstyle')
plt.gcf().set_size_inches(8, 7)

Switzerland = pd.merge(confirmed_country["Switzerland"], death["Switzerland"], left_index=True, right_index=True)
Switzerland.rename(columns = {'Switzerland_x':'Confirmed Cases'}, inplace = True)
Switzerland.rename(columns = {'Switzerland_y':'Death Cases'}, inplace = True)
Switzerland["2020-03-17":"2020-04-07"].plot(linewidth=3)
plt.title('Kasus Kematian COVID-19 di Switzerland')
plt.xlabel('Tanggal')
plt.ylabel('Jumlah Kasus Kematian')
plt.style.use('https://github.com/dhaitz/matplotlib-stylesheets/raw/master/pitayasmoothie-light.mplstyle')
plt.gcf().set_size_inches(8, 7)

Thailand = pd.merge(confirmed_country["Thailand"], death["Thailand"], left_index=True, right_index=True)
Thailand.rename(columns = {'Thailand_x':'Confirmed Cases'}, inplace = True)
Thailand.rename(columns = {'Thailand_y':'Death Cases'}, inplace = True)
Thailand["2020-04-06":"2020-04-07"].plot(linewidth=3)
plt.title('Kasus Kematian COVID-19 di Thailand')
plt.xlabel('Tanggal')
plt.ylabel('Jumlah Kasus Kematian')
plt.style.use('https://github.com/dhaitz/matplotlib-stylesheets/raw/master/pitayasmoothie-light.mplstyle')
plt.gcf().set_size_inches(8, 7)

Turkey = pd.merge(confirmed_country["Turkey"], death["Turkey"], left_index=True, right_index=True)
Turkey.rename(columns = {'Turkey_x':'Confirmed Cases'}, inplace = True)
Turkey.rename(columns = {'Turkey_y':'Death Cases'}, inplace = True)
Turkey["2020-03-22":"2020-04-07"].plot(linewidth=3)
plt.title('Kasus Kematian COVID-19 di Turkey')
plt.xlabel('Tanggal')
plt.ylabel('Jumlah Kasus Kematian')
plt.style.use('https://github.com/dhaitz/matplotlib-stylesheets/raw/master/pitayasmoothie-light.mplstyle')
plt.gcf().set_size_inches(8, 7)

US = pd.merge(confirmed_country["US"], death["US"], left_index=True, right_index=True)
US.rename(columns = {'US_x':'Confirmed Cases'}, inplace = True)
US.rename(columns = {'US_y':'Death Cases'}, inplace = True)
US["2020-03-10":"2020-04-07"].plot(linewidth=3)
plt.title('Kasus Kematian COVID-19 di US')
plt.xlabel('Tanggal')
plt.ylabel('Jumlah Kasus Kematian')
plt.style.use('https://github.com/dhaitz/matplotlib-stylesheets/raw/master/pitayasmoothie-light.mplstyle')
plt.gcf().set_size_inches(8, 7)

Ukraine = pd.merge(confirmed_country["Ukraine"], death["Ukraine"], left_index=True, right_index=True)
Ukraine.rename(columns = {'Ukraine_x':'Confirmed Cases'}, inplace = True)
Ukraine.rename(columns = {'Ukraine_y':'Death Cases'}, inplace = True)
Ukraine["2020-04-03":"2020-04-07"].plot(linewidth=3)
plt.title('Kasus Kematian COVID-19 di Ukraine')
plt.xlabel('Tanggal')
plt.ylabel('Jumlah Kasus Kematian')
plt.style.use('https://github.com/dhaitz/matplotlib-stylesheets/raw/master/pitayasmoothie-light.mplstyle')
plt.gcf().set_size_inches(8, 7)

UK = pd.merge(confirmed_country["United Kingdom"], death["United Kingdom"], left_index=True, right_index=True)
UK.rename(columns = {'United Kingdom_x':'Confirmed Cases'}, inplace = True)
UK.rename(columns = {'United Kingdom_y':'Death Cases'}, inplace = True)
UK["2020-03-16":"2020-04-07"].plot(linewidth=3)
plt.title('Kasus Kematian COVID-19 di United Kingdom')
plt.xlabel('Tanggal')
plt.ylabel('Jumlah Kasus Kematian')
plt.style.use('https://github.com/dhaitz/matplotlib-stylesheets/raw/master/pitayasmoothie-light.mplstyle')
plt.gcf().set_size_inches(8, 7)
C:\Users\BelindaM\anaconda3\lib\site-packages\pandas\plotting\_matplotlib\core.py:386: RuntimeWarning: More than 20 figures have been opened. Figures created through the pyplot interface (`matplotlib.pyplot.figure`) are retained until explicitly closed and may consume too much memory. (To control this warning, see the rcParam `figure.max_open_warning`).
  fig = self.plt.figure(figsize=self.figsize)
In [37]:
def data_kematian(raw_data_deaths):
    died = raw_data_deaths.melt(id_vars=['Province/State','Country/Region','Lat','Long'],
                                            value_vars=raw_data_deaths.iloc[:,4:],
                                            var_name='Date', value_name='Total Kasus Kematian')
   
    died["Date"] = pd.to_datetime(died["Date"])
    died = died.drop(["Province/State","Lat","Long"], axis = 1)
    died = died.groupby(['Date','Country/Region'],as_index=False).agg({'Total Kasus Kematian': 'sum'})
    return (died)

data_meninggal = data_kematian(raw_data_deaths)
list_nama = list(death.columns)
df=data_meninggal[data_meninggal['Country/Region'].isin(list_nama)]
df['Total Kasus Kematian'] = np.where((df['Total Kasus Kematian'] < 25 ) , 0, df['Total Kasus Kematian'])                
C:\Users\BelindaM\AppData\Local\Temp\ipykernel_15068\2344823607.py:14: SettingWithCopyWarning: 
A value is trying to be set on a copy of a slice from a DataFrame.
Try using .loc[row_indexer,col_indexer] = value instead

See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy
  df['Total Kasus Kematian'] = np.where((df['Total Kasus Kematian'] < 25 ) , 0, df['Total Kasus Kematian'])
In [38]:
fig = px.choropleth(df, locations="Country/Region", 
                    color=np.log(df["Total Kasus Kematian"]),
                    locationmode='country names', hover_name="Country/Region", 
                    animation_frame=df["Date"].dt.strftime('%Y-%m-%d'),
                    title='Total Kasus Kematian berdasarkan urutan waktu', color_continuous_scale=px.colors.sequential.matter)
fig.update(layout_coloraxis_showscale=False)
fig.show()
C:\Users\BelindaM\anaconda3\lib\site-packages\pandas\core\arraylike.py:397: RuntimeWarning: divide by zero encountered in log
  result = getattr(ufunc, method)(*inputs, **kwargs)

Berdasarkan hasil visualisasi di atas, negara yang memiliki kasus kematian lebih atau sama dengan 25 berjumlah 57 negara. Negara China merupakan negara pertama dari ke 57 negara yang memiliki kasus kematian lebih dari 25, total kasus kematian China yang pertama berjumlah 17 pada tanggal 22 Januari 2020. Hamir seluruh 52 negara tersebut mengalami peningkatan kasus terkonfirmasi COVID-19 di-iringi kasus kematian yang tidak terlalu berarti . Jumlah kasus kian menaik semestara peningkatan kasus kematian di setiap negara tidak sebanding. Penambahan kasus kematian yang lebih dari 25 baru muncul pada negara selain Cina pada peridoe akhir Februari 2020 (27 Februaru 2020) yakni negara Iran dan Italy.

Kasus kematian COVID-19 dimulai dari benua Asia Timur kemudia mulai merambah ke bagian benua Eropa kemudian menuju benua Amerika, baru setelah itu mulai berpencar ke berbagai belahan dunia. Selain negara China, kasus kematian dari ke 56 negara lainnya baru nampak pada akhir Februari menuju awal Maret ditandai dengan negara Iran dan Italy yang terkonfirmasi memiliki kasus kematian.

Meskipun negara China merupakan negara pertama dengan jumlah kematian yang lebih tinggi di bandingkan dengan negara lainnya, pada akhir periode tampak beberapa negara memiliki kasus yang lebih tinggi ketimbang China, yakni seperti iltalia, Prancis, UK, dan US.

5. Visualisasi jumlah pasien yang sembuh (recovered people) (Bobot: 25%)¶

Anda perlu mendapatkan informasi mengenai total pasien COVID-19 yang dinyatakan sembuh seperti pada kasus terkonfirmasi dan kasus kematian tapi, kali ini lakukan hal tersebut dengan membuat user-defined functions yang diperlukan bukan mengetik ulang barisan code yang sama seperti di nomor sebelumnya.

In [39]:
def setindex(recovered):
    recovered = recovered.set_index(['Date'])
    return recovered

def groupingsum(recovered):
    recovered = recovered.groupby(['Date','Country/Region'],as_index=False).agg({'Total Pasien Sembuh': 'sum'})
    recovered = recovered.pivot_table(index=['Date'], columns='Country/Region',
                     values='Total Pasien Sembuh', aggfunc='first').reset_index()
    return recovered


def buat_data_baru(raw_data_recovered):
    recovered = raw_data_recovered.melt(id_vars=['Province/State','Country/Region','Lat','Long'],
                                            value_vars=raw_data_recovered.iloc[:,4:],
                                            var_name='Date', value_name='Total Pasien Sembuh')
    recovered["Date"] = pd.to_datetime(recovered["Date"])
    recovered = recovered.drop(["Province/State","Lat","Long"], axis = 1)
    recovered = groupingsum(recovered)
    recovered = setindex(recovered)
    return (recovered)


recovery = buat_data_baru(raw_data_recovered)

Periksa fungsi-fungsi yang sudah anda buat

In [40]:
recovery
Out[40]:
Country/Region Afghanistan Albania Algeria Andorra Angola Antigua and Barbuda Argentina Armenia Australia Austria Azerbaijan Bahamas Bahrain Bangladesh Barbados Belarus Belgium Belize Benin Bhutan Bolivia Bosnia and Herzegovina Botswana Brazil Brunei Bulgaria Burkina Faso Burma Burundi Cabo Verde Cambodia Cameroon Canada Central African Republic Chad Chile China Colombia Comoros Congo (Brazzaville) Congo (Kinshasa) Costa Rica Cote d'Ivoire Croatia Cuba Cyprus Czechia Denmark Diamond Princess Djibouti Dominica Dominican Republic Ecuador Egypt El Salvador Equatorial Guinea Eritrea Estonia Eswatini Ethiopia Fiji Finland France Gabon Gambia Georgia Germany Ghana Greece Grenada Guatemala Guinea Guinea-Bissau Guyana Haiti Holy See Honduras Hungary Iceland India Indonesia Iran Iraq Ireland Israel Italy Jamaica Japan Jordan Kazakhstan Kenya Kiribati Korea, South Kosovo Kuwait Kyrgyzstan Laos Latvia Lebanon Lesotho Liberia Libya Liechtenstein Lithuania Luxembourg MS Zaandam Madagascar Malawi Malaysia Maldives Mali Malta Marshall Islands Mauritania Mauritius Mexico Micronesia Moldova Monaco Mongolia Montenegro Morocco Mozambique Namibia Nepal Netherlands New Zealand Nicaragua Niger Nigeria North Macedonia Norway Oman Pakistan Palau Panama Papua New Guinea Paraguay Peru Philippines Poland Portugal Qatar Romania Russia Rwanda Saint Kitts and Nevis Saint Lucia Saint Vincent and the Grenadines Samoa San Marino Sao Tome and Principe Saudi Arabia Senegal Serbia Seychelles Sierra Leone Singapore Slovakia Slovenia Solomon Islands Somalia South Africa South Sudan Spain Sri Lanka Sudan Summer Olympics 2020 Suriname Sweden Switzerland Syria Taiwan* Tajikistan Tanzania Thailand Timor-Leste Togo Tonga Trinidad and Tobago Tunisia Turkey US Uganda Ukraine United Arab Emirates United Kingdom Uruguay Uzbekistan Vanuatu Venezuela Vietnam West Bank and Gaza Yemen Zambia Zimbabwe
Date
2020-01-22 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 28 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 2 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
2020-01-23 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 30 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 2 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
2020-01-24 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 36 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 3 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
2020-01-25 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 39 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 3 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
2020-01-26 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 49 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 6 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ...
2022-01-07 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
2022-01-08 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
2022-01-09 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
2022-01-10 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
2022-01-11 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0

721 rows × 196 columns

Selanjutnya,tampilkan data total pasien COVID-19 yang sembuh dalam bentuk grafik yang sesuai. Berikan judul, labels, dan spesifikasi (ukuran, warna, ketebalan, dll) yang sesuai sehingga plot yang dihasilkan rapi, menarik, dan mudah dipahami.

In [41]:
copyrecovery=recovery.copy()
recovery["Total Pasien Sembuh dari COVID-19"] = recovery.sum(axis=1)
In [42]:
recovery.drop(recovery.iloc[:, 0:196], inplace = True, axis = 1)
sembuh = recovery['Total Pasien Sembuh dari COVID-19']
Sembuh = pd.DataFrame(sembuh)
Sembuh
Out[42]:
Total Pasien Sembuh dari COVID-19
Date
2020-01-22 30
2020-01-23 32
2020-01-24 39
2020-01-25 42
2020-01-26 56
... ...
2022-01-07 0
2022-01-08 0
2022-01-09 0
2022-01-10 0
2022-01-11 0

721 rows × 1 columns

In [43]:
plt.style.use('https://github.com/dhaitz/matplotlib-stylesheets/raw/master/pitayasmoothie-light.mplstyle')
Sembuh["2020-01-22":"2022-01-11"].plot(linewidth=3);
plt.title('Kasus Sembuh COVID-19')
plt.xlabel('Tanggal')
plt.ylabel('Jumlah Kasus Sembuh dalam satuan ratusan juta')
plt.gcf().set_size_inches(12, 8)
In [44]:
def buat_data(raw_data_recovered):
    recovered2 = raw_data_recovered.melt(id_vars=['Province/State','Country/Region','Lat','Long'],
                                            value_vars=raw_data_recovered.iloc[:,4:],
                                            var_name='Date', value_name='Total Pasien Sembuh')
   
    recovered2["Date"] = pd.to_datetime(recovered2["Date"])
    recovered2 = recovered2.drop(["Province/State","Lat","Long"], axis = 1)
    recovered2 = recovered2.groupby(['Date','Country/Region'],as_index=False).agg({'Total Pasien Sembuh': 'sum'})
    return (recovered2)

recovery2 = buat_data(raw_data_recovered)
copy_recovery2=recovery2.copy()

recovery2 = recovery2[recovery2["Date"]=="2021-08-04"]

pd.set_option("mode.chained_assignment", None)
fig=px.choropleth(recovery2, locations="Country/Region", locationmode='country names', 
                  color_continuous_scale='dense', color=np.log10(recovery2["Total Pasien Sembuh"]), range_color=(0,10))
fig.show()
C:\Users\BelindaM\anaconda3\lib\site-packages\pandas\core\arraylike.py:397: RuntimeWarning:

divide by zero encountered in log10

In [45]:
def buat_dataa(raw_data_recovered):
    recovered3 = raw_data_recovered.melt(id_vars=['Province/State','Country/Region','Lat','Long'],
                                            value_vars=raw_data_recovered.iloc[:,4:],
                                            var_name='Date', value_name='Total Pasien Sembuh')
   
    recovered3["Date"] = pd.to_datetime(recovered3["Date"])
    recovered3 = recovered3.drop(["Province/State","Lat","Long"], axis = 1)
    recovered3 = recovered3.groupby(['Date','Country/Region'],as_index=False).agg({'Total Pasien Sembuh': 'sum'})
    return (recovered3)

recovery3 = buat_dataa(raw_data_recovered)

fig = px.choropleth(recovery3, locations="Country/Region", 
                    color=np.log(recovery3["Total Pasien Sembuh"]),
                    locationmode='country names', hover_name="Country/Region", 
                    animation_frame=recovery3["Date"].dt.strftime('%Y-%m-%d'),
                    title='Total Kasus Sembuh berdasarkan urutan waktu', color_continuous_scale=px.colors.sequential.matter)
fig.update(layout_coloraxis_showscale=False)
fig.show()
C:\Users\BelindaM\anaconda3\lib\site-packages\pandas\core\arraylike.py:397: RuntimeWarning:

divide by zero encountered in log

Data raw_data_recovered terdiri dari 721 pengamatan dimulai dari tanggal 22 Januari 2020 hingga 11 Januari 2022. Dimulai dari tanggal 22 Januari 2020 kasus sembuh di berbagai belahan dunia kian bertambah hingga akhir tahun 2020, nampaknya terdapat penurunan kasus mendadak. Terlepas dari itu, peningkatan kasus sembuh terjad kembali hingga bulan Agustus 2021.Semenjak tanggal 4 Agustus 2021 seluruh isi sel dari data set raw_data_recovered bernilai 0.

Berdasarkan hasil visualisasi di atas didapatkan informasi bahwa kasus pasien sembuh telah dimuali sejak awal periode tampak pada awal periode dan terus mengalami kenaikan hingga periode awal Agustus 2021.Negara dengan kasus sembuh dimulai dari Cina dan Thailand dengan total kasus sembuh sebanyak 28 kasus dari Cina dan 2 kasus dari Thailand. Kasus sembuh berawal dari daerah benua Asia yang kemudian merambat ke benua Australia dan baru itu menjalar ke berbagai belahan dunia.

Meskipun pada awal periode negara Cina tampak memiliki jumlah kasus sembuh terbanyak, namun pada tanggal 4 Agustus 2021 negara dengan jumlah kasus sembuh terbanyak ialah berasal dari negara India disusul dengan negara Amerika Serikat, Brazil dan Rusia. Sebaliknya kasus konfirmasi sembuh terkecil ialah berasal dari negara Tanzania.

Lakukan visualisasi yang sama pada beberapa negara berikut (France, Spain, China, US, Italy, and Australia). Berikan judul, labels, dan spesifikasi (ukuran, warna, ketebalan, dll) yang sesuai sehingga plot yang dihasilkan rapi, menarik, dan mudah dipahami.

In [46]:
enamnegaraa = copyrecovery[["France", "Spain", "China", "US", "Italy", "Australia"]]
enamnegaraa = pd.DataFrame(enamnegaraa)
enamnegaraa
plt.style.use('https://github.com/dhaitz/matplotlib-stylesheets/raw/master/pitayasmoothie-light.mplstyle')
fig, axes = plt.subplots(nrows=6, ncols=1)
for i, c in enumerate(enamnegaraa.columns):
    enamnegaraa[c].plot(kind='line', ax=axes[i], title=c, xlabel="Tanggal", ylabel="Total Kasus Sembuh", legend=c)
plt.subplots_adjust(hspace = 1.0)
plt.gcf().set_size_inches(10, 28)
In [47]:
plt.style.use('https://github.com/dhaitz/matplotlib-stylesheets/raw/master/pitayasmoothie-light.mplstyle')
enamnegaraa.plot(linewidth=3)
plt.title('Kasus Sembuh COVID-19 di Enam Negara dalam satuan juta')
plt.xlabel('Tanggal')
plt.ylabel('Jumlah Kasus Sembuh dalam satuan juta')
plt.gcf().set_size_inches(12, 8)

Dari visualisasi diatas didapatkan hasil bahawa hampir setiap negara mengalami pertambuhan kasus sembuh COVID-19. Mayoritas setiap negara tidak mengalami pertumbuhan kasus sembuh pada periode Agustus 2021, hanya negara Amerika Serikat saja yang pada akhir tahun 2020 mengalami pemberhentian penambahan kasus hingga januari 2022. Hal ini mungkin menjadi salah satu penyebab mengapa pada kurva kaus sembuh secara global, di akhir tahun 2020 terjadi penurunan kasus sembuh secara mendadak. Selain itu didapatkan pula informasi sebagai berikut:

  • Negara China merupakan negara tercepat dari keenam negara yang mendapatkan konfirmasi kasus sembuh. Kasus sembuh mulai nampak pada periode akhir Januari 2020. Pada periode Januari sampai April negara Cina cukup memiliki penambahan kasus yang signifikan, akan tetapi setelah itu penambahan kasus sembuh cenderung menjadi lebih sedikit.
  • Sebaliknya, negara Amerika Serikat merupakan negara terlambat dari keenam negara yang mendapatkan konfirmasi kasus sembuh, yakni sekitar priode akhir maret.
  • Negara Spanyol pada periode Mei-Juni 2021 tidak mengalami pertambahan jumlah yang berarti, hal ini ditandakan dengam bentuk garis yang mendatar.
  • Meskipun negara Amerika Serikat paling cepat mengalami pemberhentian pertumbuhan, namun bila dilihat per 4 Agustus 2021, negara Ameria Serikat tetap berdiri sebagai dengan kasus konfirmasi sembuh terbanyak disusul dengan negara Italy, kemudian Prancis.
In [ ]: